Replies: 2 comments 4 replies
-
Yea this seems like we could add that as an option. Pretty straightforward. (I have some questions about how much these actually add protection in a React apps but it seems at least valid as an option.) Longer term I hope we’ll be able to do this technique with a built in HTML primitive instead of script tags. |
Beta Was this translation helpful? Give feedback.
-
Another possible strategy would be to include a high pri src script (on a trusted domain) that uses a mutation observer to track new segment nodes and moves them. Effectively a polyfill of the ideal solution. The downside of this is that you need another request to get this script - however - you likely need one for CSS anyway so it's not much worse. This is probably better for SSG where nonce wouldn't be safe. |
Beta Was this translation helpful? Give feedback.
-
We currently set a nonce for our
script-src
CSP policy which means that inline scripts can only be executed if they have the same nonce value set. Based on my testing, this causes issues when streaming withpipeToNodeWritable
due to the inline script tags that are sent down.I was curious if there is any way to address this (outside of changing our CSP policy). One option that comes to mind is being able to specify a
nonce
that would then get added to the inline script tags.Beta Was this translation helpful? Give feedback.
All reactions