问题描述
我们有一个网站,该网站在数据输入表单中包含一些Ajax调用。
我们最近从服务器添加了CSP标头,并且Ajax调用是其中之一,允许调用。
其中一个用户看到以下错误,这仅发生于该用户,并且同一网络中的其他用户都没有看到问题或阻止程序。
错误:
Refused to connect to 'https://example/foo/bar?jsoncallback=jsonp1600112081291&userProfileId=19440&begins=%2525' because it violates the following Content Security Policy directive: "connect-src *.example.com *.example.biz *.example1.com *.example3.com *.example4.com *.appdynamics.com *.eum-appdynamics.com *.example5.net data:".
任何重现问题的帮助或建议都将非常有帮助。
预先感谢
解决方法
连接到'https:// example / foo / bar?jsoncallback = ...
您使连接到错误的主机名。您没有机会在CSP中允许此类主机。
connect-src * .example.com * .example.biz * .example1.com * .example3.com * .example4.com * .appdynamics.com * .eum-appdynamics.com * .example5.net数据:
列表包含不存在的域,要出售的域。看起来不像CSP的真实网站。