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

Use report-to instead of the deprecated report-uri #166

Open
sandstrom opened this issue Nov 24, 2020 · 1 comment
Open

Use report-to instead of the deprecated report-uri #166

sandstrom opened this issue Nov 24, 2020 · 1 comment

Comments

@sandstrom
Copy link
Collaborator

sandstrom commented Nov 24, 2020

The new Reporting API is not supported by all browsers yet, so this isn't something we need to move on for at least another year or so. As of November 2020 it's not yet supported by Firefox or Safari.

https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy/report-to

  1. At some point we'll want to add support for report-to in addition to report-uri. With both are present and the browser support both, report-to takes precedence.
  2. Separately, when all browsers supported by ember has support for report-to we'll want to drop the report-uri value.

Opened since @jelhan asked me to: #148

Background

@jelhan
Copy link
Collaborator

jelhan commented Nov 24, 2020

Thanks a lot for opening this issue.

  1. At some point we'll want to add support for report-to in addition to report-uri. With both are present and the browser support both, report-to takes precedence.
  2. Separately, when all browsers supported by ember has support for report-to we'll want to drop the report-uri value.

Sounds like a plan. Let's do it. 😄

I see two parts of the addon being affected by that change:

  1. report-uri option of csp-headers Ember CLI command: ember csp-headers --report-uri http://examples.com https://github.com/rwjblue/ember-cli-content-security-policy/blob/414cf2dc89d9b7f547a1f63ef90c7f45d91b227d/lib/commands.js#L23-L27
  2. report-uri directive injected if using development server to report CSP violations on the terminal: https://github.com/rwjblue/ember-cli-content-security-policy/blob/2e2e7254e6c700d226b7194a3a1ea05f7b73ba4d/index.js#L150-L162

For the CLI command I tend toward renaming it to report-to and adding report-uri as an alias until we reach phase 2.

A pull request implementing this is welcome.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants