javascript - 带有查询参数的 Firebase 函数 GET 请求返回 400 错误
问题描述
当我base
通过邮递员执行 GET 到:http://localhost:5001/api-name/region/base
.
但是当我在 URL 中添加 get 参数时,请求失败,即http://localhost:5001/api-name/region/base?origin=localhost
. 我收到 400 错误请求错误。有趣的是,当邮递员几乎立即报告 400 Bad Request 时,firebase 模拟器的行为就像它仍在运行该功能并在 60 秒后超时。
我有函数运行时选项可以将请求设置为 300 秒(因为这是一个很大的查询并且需要一段时间,所以在没有参数的情况下也可以按预期工作),所以看起来它甚至没有被路由到正确的函数或任何地方。
解决方案
我遇到过同样的问题。解决方案是更新到最新版本的 firebase-tools。
如果使用 npm:
npm install -g firebase-tools@latest
这是 v9.2.1 中修复的错误。更多信息在这里:https ://github.com/firebase/firebase-tools/releases/tag/v9.2.1
推荐阅读
- reactjs - react-redux RangeError:超出最大调用堆栈大小
- pine-script - 如何在 tradingview pine 编辑器中获取第二个 15m 蜡烛的范围?
- css - 如何解决 CSS 元素之间的冲突?
- python - python boto3 如何在镶木地板上配置 AWS s3select?
- node.js - CredentialsError:配置中缺少凭据。在 EC2 中使用 S3 SDK 时
- api - 我如何告诉 Gitlab 通过 API 镜像我的 Github 存储库?
- ballerina - 芭蕾舞女演员:外来输入“S”期待{
, '','','',''} 使用 ballerina/config 读取配置时出现错误 - python - 遍历 pandas 数据帧,同时保留早期状态的内存
- linear-regression - 没有标签的线性回归
- angular - 如何根据当前用户的登录名更改数据