-
-
Notifications
You must be signed in to change notification settings - Fork 67
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
Fix CSP support #149
Comments
Hey Carson, I wasn't really aware of CSP, thanks for raising this issue. |
👋 @crkent still wanna open a PR on this topic? |
Hi @cblavier, congrats on this super cool library, I absolutely love it! I was wondering if there is a reason this got closed. I am still getting this. How to replicateMake sure the pipeline :browser do
# other plugs
plug :put_secure_browser_headers, %{"content-security-policy" => "default-src 'self'"}
end |
Just to add more context, this is an issue Phoenix Live Dashboard was having as well, and the following discussion is very interesting to read to find a similar solution. |
Thanks for your feedback, Beatrice. I will reopen it, and get it fixed! |
Beatrice is my last name, I go by Gaia 😁 Let me know if you need help, I can probably whip up a PR if needed. |
Sorry about that, Gaia :) |
Hey Gaia, still want to open a PR? Need any help? |
Hi, sorry, I'm having some really busy times this period, I was planning on work on this at the end of this week. If it's too late let me know |
No that's fine! |
Why was this closed? I am having this issue in the latest version. |
This was closed by lack of external contribution 🤷♂️ I'd be more than happy to receive a PR on the topic, I don't know anything about CSP |
Hi sorry for the enormous and inexcusable delay. I came back to work on this and I am having some issues with some inline styles. I can still open the PR, so someone more expert on the frontend can maybe help. |
Thanks a lot, @gaiabeatrice 🙏🙏🙏 I also had issues with favicons, but I fixed it by allowing
From my understanding, the nonce should have been enough, but anyway, that did the trick. |
Code highlighting breaks for applications which set CSPs. This is due to the use of an inline style element to add (Makeup-generated) highlighting.
https://github.com/phenixdigital/phx_live_storybook/blob/a6a8c6beae69fa30f96083acd4cf33b1fc54edea/lib/phx_live_storybook/templates/layout/root.html.heex#L28-L30
To fix this, the simplest solution could be to add support for a nonce parameter from the conn. Happy to submit a pull request for this, if desired.
The text was updated successfully, but these errors were encountered: