-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Send a configurable CSP in every HTML response #9665
base: master
Are you sure you want to change the base?
Commits on Oct 29, 2024
-
Send a configurable CSP in every HTML response
The CSP gets adapted to remote objects being allowed or not. It can be configured or disabled via the config option `content_security_policy` (and `content_security_policy_add_allow_remote`).
Configuration menu - View commit details
-
Copy full SHA for 801f375 - Browse repository at this point
Copy the full SHA 801f375View commit details -
Configuration menu - View commit details
-
Copy full SHA for 0d1b036 - Browse repository at this point
Copy the full SHA 0d1b036View commit details -
Configuration menu - View commit details
-
Copy full SHA for 3882b73 - Browse repository at this point
Copy the full SHA 3882b73View commit details -
Configuration menu - View commit details
-
Copy full SHA for 6f00ac2 - Browse repository at this point
Copy the full SHA 6f00ac2View commit details -
Add additional CSP header values only if present
If people write a lax default CSP they might set the additional config option to the blank string, or false. Then the CSP header should not contain that value.
Configuration menu - View commit details
-
Copy full SHA for feb8e9f - Browse repository at this point
Copy the full SHA feb8e9fView commit details
Commits on Oct 30, 2024
-
Configuration menu - View commit details
-
Copy full SHA for bc6b241 - Browse repository at this point
Copy the full SHA bc6b241View commit details -
Use hardcoded defaults for CSP options
This way the code always has values it can work with, no matter how good or broken the configuration is.
Configuration menu - View commit details
-
Copy full SHA for 5db41a1 - Browse repository at this point
Copy the full SHA 5db41a1View commit details -
Configuration menu - View commit details
-
Copy full SHA for 383e8b5 - Browse repository at this point
Copy the full SHA 383e8b5View commit details -
Improve readability of CSP value checks
Previously the code also treated `'false'` (the string) as invalid, but that's a very specific check against a specific edge case, which wouldn't even break the code (but will only make the browser complain), so I'm dropping that check.
Configuration menu - View commit details
-
Copy full SHA for 8b631ab - Browse repository at this point
Copy the full SHA 8b631abView commit details -
Configuration menu - View commit details
-
Copy full SHA for 10f7598 - Browse repository at this point
Copy the full SHA 10f7598View commit details -
The config value might be something else than a string.
Configuration menu - View commit details
-
Copy full SHA for 1afa897 - Browse repository at this point
Copy the full SHA 1afa897View commit details -
Make CSP header building more robust.
In the previous way useless semicolons could have happened.
Configuration menu - View commit details
-
Copy full SHA for 37db3ef - Browse repository at this point
Copy the full SHA 37db3efView commit details -
Remove type annotation because PHP v7
We still support PHP v7, which doesn't support union types.
Configuration menu - View commit details
-
Copy full SHA for ef5aae3 - Browse repository at this point
Copy the full SHA ef5aae3View commit details -
Mitigate erronous complaint of phpstan
phpstan complains that `assertIsArray($config)` will always fail because it doesn't know about the side effects of `require`ing the default config.
Configuration menu - View commit details
-
Copy full SHA for b1ea913 - Browse repository at this point
Copy the full SHA b1ea913View commit details -
Configuration menu - View commit details
-
Copy full SHA for fda480b - Browse repository at this point
Copy the full SHA fda480bView commit details