Skip to content

Add exceptions to Content-Security-Policy - #3113

Merged
JacobCoffee merged 2 commits into
python:mainfrom
sethmlarson:resolve-csp-errors
Sep 11, 2026
Merged

Add exceptions to Content-Security-Policy#3113
JacobCoffee merged 2 commits into
python:mainfrom
sethmlarson:resolve-csp-errors

Conversation

@sethmlarson

Copy link
Copy Markdown
Contributor

Part of #3041, now that we have reporting in place we can begin ratcheting down the policy based on reports. This PR:

  • Uses the constants provided by django-csp for SELF, NONCE, UNSAFE_INLINE.
  • Adds exceptions for the domains we use today
  • Upgrades all script and style URLs for ajax.googleapis.com to use HTTPS, not the current scheme.
  • Adds nonces to the inline scripts included in the base template.

Modernizr unfortunately forces us to use unsafe-inline for style because it unconditionally injects <style> tags into the DOM.

@JacobCoffee
JacobCoffee enabled auto-merge (squash) September 11, 2026 19:18
@JacobCoffee
JacobCoffee merged commit 34fc2ff into python:main Sep 11, 2026
7 checks passed
@sethmlarson
sethmlarson deleted the resolve-csp-errors branch September 11, 2026 19:27
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

Successfully merging this pull request may close these issues.

2 participants