Skip to content
This repository was archived by the owner on Apr 8, 2020. It is now read-only.

Added nonce to prerender script output to support CSP #937

Closed
wants to merge 1 commit into from
Closed

Added nonce to prerender script output to support CSP #937

wants to merge 1 commit into from

Conversation

nilsgs
Copy link

@nilsgs nilsgs commented May 15, 2017

Currently we need to use script-src 'unsafe-inline' in the Content Security Policy header to get access to the global js object added to the page by the prerenderer.

I've added an optional asp-prerender-nonce attribute, to overcome this limitation.

@buvinghausen
Copy link

This has been sitting here for 5 months I want this functionality as allowing unsafe-inline in your CSP is pretty much as good as not having a CSP....

@ghost ghost removed the cla-not-required label Nov 14, 2017
@ghost ghost deleted a comment from dnfclas Nov 14, 2017
@SteveSandersonMS
Copy link
Member

Since we're moving away from the use of Globals in prerendering (because the newer middleware-based approach used in the Angular CLI and create-react-app templates generates the entire HTML doc, not just some elements that are injected into a larger doc), there probably isn't a strong need for this any more. Developers get to control their entire prerendered page and can therefore do whatever they want to insert CSP attributes, etc. I'll therefore close this - hope that's OK, and thanks again for the original contribution!

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

Successfully merging this pull request may close these issues.

4 participants