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

feat(CSP): Added optional custom impl function that creates a report-uri #67

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

mstuart
Copy link
Contributor

@mstuart mstuart commented Oct 6, 2015

  • Added optional custom impl function that creates a report-uri. Used if you want to tack on a token or some unique identifier to the end of the report-uri to help identify a user or session (for logging, analytics, etc.)
  • Added a unit test

img

/cc @jasisk

@mstuart mstuart force-pushed the master branch 2 times, most recently from 1425157 to 6043229 Compare October 6, 2015 05:28
@jasisk
Copy link
Contributor

jasisk commented Oct 6, 2015

Looks good to me.

@@ -71,6 +71,7 @@ If enabled, the CSRF token must be in the payload when modifying data or you wil
* `options.policy` Object - Object definition of policy.
* `options.reportOnly` Boolean - Enable report only mode.
* `options.reportUri` String - URI where to send the report data
* `options.impl` Function - Optional. Custom implementation to create a report-uri.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it would be better to note in the documentation that the impl will have high precedence over the reportUri

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point, thx!

@mstuart
Copy link
Contributor Author

mstuart commented Oct 7, 2015

Thx for the feedback @thefourtheye

@@ -71,6 +71,7 @@ If enabled, the CSRF token must be in the payload when modifying data or you wil
* `options.policy` Object - Object definition of policy.
* `options.reportOnly` Boolean - Enable report only mode.
* `options.reportUri` String - URI where to send the report data
* `options.impl` Function - Custom implementation to create a report-uri (higher priority than `options.reportUri`)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Now it is missing the optional part.

@turboMaCk
Copy link
Contributor

This looks good. Any blocker?

@jasisk
Copy link
Contributor

jasisk commented Dec 10, 2015

@turboMaCk does this satisfy your needs as well?

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.

5 participants