2017-10-09 26 views
1

每當我嘗試,如文檔中描述的加載資產,發現here,我不斷收到以下錯誤:斯卡拉播放「使用配置和AssetsFinder」下的錯誤裝載資產

angular-1.6.4.min.js:sourcemap:202 Refused to apply inline style because it violates the following Content Security Policy directive: "default-src 'self'". Either the 'unsafe-inline' keyword, a hash ('sha256-1PxuDsPyGK6n+LZsMv0gG4lMX3i3XigG6h0CzPIjwrE='), or a nonce ('nonce-...') is required to enable inline execution. Note also that 'style-src' was not explicitly set, so 'default-src' is used as a fallback.

誰能告訴我是什麼我可能做錯了,或者如何解決這個問題?這似乎很奇怪不應該出現這個錯誤....

編輯:

從NBoo提供的答案,我試圖指定用CSP標題:

Ok("Index").withHeaders(SecurityHeadersFilter.CONTENT_SECURITY_POLICY_HEADER -> "default-src 'unsafe-inline'") 

我設置play.filters.headers.allowActionSpecificHeaders = true 但現在我得到其他腳本的錯誤。

回答