私は理解できない奇妙なエラーに直面しています。小さなプロジェクトをAWS Elastic Beanstalkインスタンスにデプロイしようとすると、いくつかのCSPエラーが発生しています。私のプロジェクトにはいくつかのルートを扱う小さなNode.jsバックエンドを除いてjavascriptが含まれていなくても、インラインスクリプトの実行に関して不満を抱いているようです。私はNode.jsのバックエンドとそれが提供するHTMLファイルの両方ですべての私の要求にCSPヘッダを追加しようとしましたAWSのコンテンツセキュリティポリシー
Refused to execute inline script because it violates the following
Content Security Policy directive: "script-src
https://d2aafqm3hbgbf6.cloudfront.net
https://d2q66yyjeovezo.cloudfront.net
https://d1idiovbex4hy4.cloudfront.net
https://d3e2aud6m9sl41.cloudfront.net https://phd.aws.amazon.com
https://resources.console.aws.amazon.com https://signin.aws.amazon.com
*.signin.aws.amazon.com https://d36cz9buwru1tt.cloudfront.net
https://media.amazonwebservices.com 'self'". Either the 'unsafe-inline'
keyword, a hash ('sha256-
WkLxG82JrIV0IxhYdEMt3pgYi6ZRYB9ZAj35iFKh8N8='), or a nonce
('nonce-...') is required to enable inline execution.
:私は取得していますエラーがこれです。
app.use(function(req, res, next){
res.header("Content-Security-Policy", "default-src * 'unsafe-inline'
'unsafe-eval' data: blob:;");
next();
})
メタタグ:
<meta http-equiv="Content-Security-Policy" content="default-src * 'unsafe-inline' 'unsafe-eval' data: blob:;">
誰かが私が間違っているつもり場所を見つけ出す助けてくださいことはできますか?
ありがとうございました