content-security-policy - 是否允许将表单操作设置为在内容安全策略中包含 *.localhost:3000?
问题描述
我收到此错误:
Refused to send form data to 'http://example-subdomain.localhost:3000/'
because it violates the following Content Security Policy directive:
"form-action 'self' *.example.co *.localhost:3000".
所以很简单,我想从登台服务器(example-staging.com
)重定向到本地机器(http://example-subdomain.localhost:3000/
)。当我localhost:4000
用于我的后端应用程序时,它工作得很好,所以重定向localhost:4000
到http://example-subdomain.localhost:3000/
.
因此,为了澄清什么是什么:
http://example-subdomain.localhost:3000/
- 本地机器上的前端应用程序
example-staging.com
- 登台服务器,后端 api
localhost:4000
- 本地机器上的后端应用程序
解决方案
我只在 Chrome 中测试了这个东西。它在 Firefox 中运行良好。看起来像 Chrome 浏览器中的错误。我要报告它。
推荐阅读
- javascript - javascript将数据流式传输到网页的最佳实践是什么?
- python - smtplib 电子邮件不发送,脚本继续运行,没有错误消息
- postgresql - 自定义聚合函数 parallel = safe 在 postgres 13.3 中生成语法
- python - pandas.groupby 中的函数 any() 是否短路?
- python - 为子进程提供 CPU 时间和内存
- git - 2个文件夹'.git/origin'和.git/refs/remotes/origin有什么区别?
- r - 检查 data.frame 是否是另一个 data.frame 的子集
- c# - 使用 BouncyCastle 验证 Android KeyStore 签名的有效负载
- python - 如何通过python下载inta配置文件
- php - 如何在 WordPress 中加入或激活代码页面?