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

'report-to' directive implemented incorrectly, needs it's own header #4

Closed
myartsev opened this issue Jan 13, 2020 · 1 comment
Closed

Comments

@myartsev
Copy link
Contributor

The report-to directive should be taking in a 'group-name' string that references the values inside a separate Report-To header.

It looks like this library needs to be updated to:

  1. Clean up report_to because it should not be taking a json object, but rather a string corresponding to the group name

  2. Add a Report-To header

Happy to send a PR, just wanted to run this by you guys to check that I'm not mistaken or overlooking something.

This header is currently only supported on Chrome, but it's the future once report-uri gets fully deprecated: https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy/report-uri

Correct sample policy:

Report-To: { "group": "csp-endpoint",
             "max_age": 10886400,
             "endpoints": [
               { "url": "https://example.com/csp-reports" }
             ] },
           { "group": "hpkp-endpoint",
             "max_age": 10886400,
             "endpoints": [
               { "url": "https://example.com/hpkp-reports" }
             ] }
Content-Security-Policy: ...; report-to csp-endpoint
@myartsev
Copy link
Contributor Author

Fixed with #6

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