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

[minor][feat] Allow inline scripts to be marked with a nonce for CSP protection #486

Merged
merged 3 commits into from
Jul 24, 2017

Conversation

bodawei
Copy link
Contributor

@bodawei bodawei commented Jul 19, 2017

Modified react-webapp to notice when a nonce value has been provided, and if so attaches
it to any <script> tags and the critical css tag that are generated. See also https://developer.mozilla.org/en-US/docs/Web/HTTP/CSP

Fix for #474

Note: Internal feedback suggested that in some cases a function would be a more general way to get the none value, so added this as an alternative. Modified docs and tests to test both with a string and the function.

…protection

Modified react-webapp to notice when a nonce value has been provided, and if so attaches
it to any <script> tags that are generated. See also https://developer.mozilla.org/en-US/docs/Web/HTTP/CSP
@bodawei
Copy link
Contributor Author

bodawei commented Jul 20, 2017

The continuus-integration tests appear to have failed in generator-electrode, which is unrelated to my change. Am I reading this wrong?

@jchip
Copy link
Member

jchip commented Jul 22, 2017

where are you adding the Content-Security-Policy HTTP header?

@bodawei
Copy link
Contributor Author

bodawei commented Jul 23, 2017

Adding it with a plugin called blankie. This is just the change to catch the value from that, or any other similar plugin.

@jchip jchip merged commit 08f3f6f into electrode-io:master Jul 24, 2017
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