跳到主要內容

關於 ZAP 弱掃報告的 Secure Header 問題(2)

依照上一篇「關於 ZAP 弱掃報告的 Secure Header 問題(1)」的設定,網頁必定跑版。如果修改如下:[code]script-src 'self' 'unsafe-inline' 'nonce-xxx'; \style-src 'self' 'unsafe-inline' 'nonce-xxx'; \[/code]加上 'unsafe-inline' 可以解決跑版問題,但是 ZAP 弱掃報告會出現兩條缺失:[code]script-src unsafe-inlinestyle-src unsafe-inline[/code]這意思就是不能用 unsafe-inline。

關於 ZAP 弱掃報告的 Secure Header 問題(2)
依照上一篇「關於 ZAP 弱掃報告的 Secure Header 問題(1)」的設定,網頁必定跑版。
如果修改如下:
[code]
script-src 'self' 'unsafe-inline' 'nonce-xxx'; \
style-src 'self' 'unsafe-inline' 'nonce-xxx'; \
[/code]
加上 'unsafe-inline' 可以解決跑版問題,但是 ZAP 弱掃報告會出現兩條缺失:
[code]
script-src unsafe-inline
style-src unsafe-inline
[/code]
這意思就是不能用 unsafe-inline。