【问题标题】:Http redirects to https but it's not support in post request methodHttp 重定向到 https 但在 post 请求方法中不支持
【发布时间】:2017-11-15 06:10:14
【问题描述】:

我是 firebase 的新人,我第一次完成了 firebase 托管,但面临一个关于重定向的问题

firebase 托管直接将 http:// 重定向到 https://,但我尝试使用 post 请求,它工作正常,但发布的 json 数据无法处理

这是我的 firebase.json 重定向规则 http://prntscr.com/han083

这是它的截图

这是我的代码 http://prntscr.com/hamzv9

没有 https:// http://prntscr.com/hamybm

使用 https:// http://prntscr.com/hamyxh

【问题讨论】:

    标签: firebase google-cloud-firestore firebase-hosting


    【解决方案1】:

    这是因为POST 正文通常无法在重定向中存活。这可能是 Firebase Hosting 部分的一个小错误(或者可能是您用来发出请求的任何工具的部分)——HTTP 响应应该是 301 重定向,然后必须使用完整的 POST 正文重试客户。

    一般来说,对于除GET 之外的任何请求,您都需要确保预先正确指向 HTTP/HTTPS,因为重定向不会保留大多数用户代理中的所有请求信息。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2018-06-24
      • 2020-07-24
      • 1970-01-01
      • 2021-12-09
      • 2019-09-08
      • 1970-01-01
      • 2019-05-07
      相关资源
      最近更新 更多