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

Change rate-limiting middleware to remove CSP report-only header entirely when not reporting #248

Open
robhudson opened this issue Nov 22, 2024 · 0 comments

Comments

@robhudson
Copy link
Member

Description

Some browsers log a console warning when they detect a Content-Security-Policy-Report-Only header that does not include a report-uri or report-to directive. Currently, the rate-limiting middleware removes these directives when the percentage threshold is reached, leading to this warning.

Proposed Changes

  1. For the enforced CSP header:

    • Retain the current behavior: remove the report-uri or report-to directives only when the percentage threshold is reached.
  2. For the report-only CSP header:

    • Modify the behavior to completely remove the header when the percentage threshold is reached to avoid unnecessary browser warnings.
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

1 participant