-
Notifications
You must be signed in to change notification settings - Fork 439
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
Content Security Policy not properly detected in Rails #651
Comments
@rbclark I'm running into the same problem - did you ever figure out a solution? |
I've been running with |
Ok cool - thanks for the tip. I think a reasonable fix would be to remove the |
Here's an alternative, add this to your
That will initialize an empty policy prior to bullet init which makes |
I'm wondering if @baueric's solution ☝️ is still the recommended workaround. |
I currently have a content security policy setup in my application, however it is not detected by bullet (I am running v7.0.7 of bullet). In order to investigate I went ahead and put a breakpoint in the bullet loader and discovered the following:
based on this it looks like bullet is loading too early and is ill positioned to actually detect whether the CSP middleware is loaded. In order to try to fix I tried moving the bullet initializer before and after the CSP loader but to no avail.
If I modify the bullet code to always call
app.middleware.insert_before ActionDispatch::ContentSecurityPolicy::Middleware, Bullet::Rack
then everything works properly, which confirms the issue is the loader not being able to detect the CSP.The text was updated successfully, but these errors were encountered: