Skip to content
This repository has been archived by the owner on Aug 29, 2023. It is now read-only.

Problem using Content-Security-Policy with Print Syle #12140

Closed
jenskelkel opened this issue Dec 25, 2021 · 1 comment
Closed

Problem using Content-Security-Policy with Print Syle #12140

jenskelkel opened this issue Dec 25, 2021 · 1 comment
Assignees

Comments

@jenskelkel
Copy link

jenskelkel commented Dec 25, 2021

I set the Content-Security-Policy in Webserver
Then I got the folling error in Browser:

Refused to execute inline event handler because it violates the following Content Security Policy directive: "script-src 'self'". Either the 'unsafe-inline' keyword, a hash ('sha256-...'), or a nonce ('nonce-...') is required to enable inline execution. Note that hashes do not apply to event handlers, style attributes and javascript: navigations unless the 'unsafe-hashes' keyword is present.

The Problem is the following Line in the index-html

<link rel="stylesheet" href="styles.d65f2e5b705f26f2.css" media="print" onload="this.media='all'">

Angular generate this Line automatically.

How can I fix this problem. I don't want use unsafe-inline or so

Thanks for help

@Splaktar
Copy link
Member

Thank you for taking the time to submit this issue. However it does not follow our required issue template.

Please submit Angular Material and CDK questions here and issues here. This repo is for AngularJS Material.

Additionally, you may want to read through angular/angular#37631.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants