javascript - 在内容安全策略中添加 url
问题描述
我将 CSP 添加到我的项目中。我打电话给一个外部网址:http://xx.xx.xx:3002/socket.io
response.addHeader(HEADER_NAME, "default-src 'self' 'unsafe-inline' 'unsafe-eval'; */socket 'self' 'unsafe-inline' 'unsafe-eval'")
但是在我的浏览器中,我遇到了错误:
/socket.io/?EIO=3&transport=polling&t=NNrFFxf
Content security policy: The options for this page have blocked the loading of a resource
at https://xx.xx.xx.xx:3002/socket.io/?EIO=3&transport=polling&t=NNrFz_O (default-src).
Content security policy: Unable to process unknown directive '* / socket'
有什么建议吗?
解决方案
推荐阅读
- amazon-web-services - 配置 dynamoDb 流以仅在删除时调用 lambda 函数
- excel-formula - 如何在 Excel 中以特定间隔实现公式
- android - 约束布局不能在 API 21、22 上正确运行吗?
- c - C中的常量指针
- shell - shell中的`set`选项
- c++ - 使用 rangev3 在 C++ 中模拟 python 样式的列表理解?
- amazon-web-services - AWS Route 53 + Elastic Beanstalk + 证书管理器:通配符 (*) 不起作用
- php - 使用 PHP 将两个数组深度组合。第二个数组是多维的
- java - java在将图像编码和解码为base64时出现内存不足异常
- laravel - laravel 刀片中@lang 的三元条件