You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm using gulp browserSync. Now I need to implement and test a CSP policy.
BrowserSync itself injects a script on the fly into my HTML code, starting with a <script> tag just below :
Using a policy like script-src 'unsafe-inline' would work, but that couteracts the whole point of testing out nonces and hashes. So I guess I'd need a nonce or a hash in browserSync's <script> tag, but I don't have control over it. Now how can that be done? Or are there other solutions?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I'm using gulp browserSync. Now I need to implement and test a CSP policy.
BrowserSync itself injects a script on the fly into my HTML code, starting with a <script> tag just below :
<script id="__bs_script__">
This tag doesn't include a
nonce
needed for CSP.This is my browserSync config in the gulpfile.js:
Using a policy like
script-src 'unsafe-inline'
would work, but that couteracts the whole point of testing out nonces and hashes. So I guess I'd need a nonce or a hash in browserSync's <script> tag, but I don't have control over it. Now how can that be done? Or are there other solutions?Beta Was this translation helpful? Give feedback.
All reactions