-
Notifications
You must be signed in to change notification settings - Fork 105
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
Change rate-limiting middleware to remove CSP report-only header entirely when not reporting #248
Comments
I'm thinking about the utility of having the RO CSP even without reporting endpoints, or when outside of the %% percentage sample, somehow optionally; for debug/dev purposes. While it's unfortunate for prod environments given the console warnings, it might have some utility for nonprod use even then, as it still warns if any RO violates, right there in the console. Didn't think about a good design for such route, effectively being a "config" that would allow emitting even if otherwise not reported for the response, just wanted to share before I forget;) (Not something blocking this issue/PR, only thinking out loud in case a followup feature making this behavior configurable could make sense.) |
Description
Some browsers log a console warning when they detect a
Content-Security-Policy-Report-Only
header that does not include areport-uri
orreport-to
directive. Currently, the rate-limiting middleware removes these directives when the percentage threshold is reached, leading to this warning.Proposed Changes
For the enforced CSP header:
report-uri
orreport-to
directives only when the percentage threshold is reached.For the report-only CSP header:
The text was updated successfully, but these errors were encountered: