Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CSP support #378

Open
archfz opened this issue Mar 13, 2022 · 2 comments
Open

CSP support #378

archfz opened this issue Mar 13, 2022 · 2 comments

Comments

@archfz
Copy link

archfz commented Mar 13, 2022

Expected Behaviour

The most useful CSP rule for style is to disallow inline styles. This should work correctly with frappe charts.

Actual Behaviour

Styles are blocked and frappe charts is not working correctly.

Steps to Reproduce:

  1. Use frappe charts.
  2. Configure CSP and do not allow unsafe-inline:
 <meta http-equiv="Content-Security-Policy" content="style-src 'self' *.mydomain.ro mydomain.ro 'nonce-BnP58e96vet5BG2gurtvnauzi1PdyH7u'">

image

Frappé Charts version: 1.6.2

@scmmishra
Copy link
Contributor

I don't have the bandwidth to take this up at the moment, if you could raise a PR fixing this, I'll be happy to review it

@DoodlesEpic
Copy link

Just a note for anyone passing by: If you cannot use 'unsafe-inline' because you have at least one hash on the style-src directive, then you have to add 'unsafe-hashes' to the style-src directive and hardcode the hashes that Chromium dev tools give you to the style-src directive. Really not ideal but better than having to disable it completely. You could also do this instead of adding 'unsafe-inline' as I believe it better makes use of the csp.

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

No branches or pull requests

3 participants