1
我有一個Nginx的CSP配置如下:Nginx的CSP框架-SRC忽略
add_header Content-Security-Policy "default-src 'self';script-src 'self' 'unsafe-eval' https://www.google-analytics.com/analytics.js;img-src 'self' https://ssl.google-analytics.com data:;style-src 'self' 'unsafe-inline';font-src 'self' 'unsafe-inline';frame-src 'self' https:;object-src 'self';connect-src 'self' ws:;media-src 'self'
當我嘗試在Chrome加載網頁我看到:
Refused to frame 'https://myexternalwebsite.com/a/b/index.html' because it violates the following Content Security Policy directive: "default-src 'self'". Note that 'frame-src' was not explicitly set, so 'default-src' is used as a fallback.
在我的CSP框架-SRC已明確設置並具有「自我」值,並且https:
我該做什麼錯?
如果將「https:」添加到默認策略中會發生什麼? frame-src在CSP 2中已棄用,因此Chrome可能會忽略它? – seanwatson
檢查瀏覽器收到的標題 –