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

Add support for new Content-Type #91

Merged
merged 2 commits into from
Mar 17, 2021
Merged

Add support for new Content-Type #91

merged 2 commits into from
Mar 17, 2021

Conversation

jozo
Copy link
Contributor

@jozo jozo commented Mar 17, 2021

New Content-Type should be "application/csp-report"
https://w3c.github.io/webappsec-csp/

This should be merged (or fixed otherwise) ASAP because current content_type check breaks CSP reporting from new browsers.

New Content-Type should be "application/csp-report"
https://w3c.github.io/webappsec-csp/
@jozo
Copy link
Contributor Author

jozo commented Mar 17, 2021

Check this @Gee19

@Gee19
Copy link
Member

Gee19 commented Mar 17, 2021

@jozo Thanks for the contribution. Do you mind modifying your code slightly for readability sake?

acceptable_content_types = ['application/json', 'application/csp-report']
if content_type not in acceptable_content_types:

@jozo
Copy link
Contributor Author

jozo commented Mar 17, 2021

Good point. I also moved it to import level so we won't create the list over and over for every request.

@Gee19 Gee19 merged commit 69a12d8 into sdelements:master Mar 17, 2021
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