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
Currently, the support for CSP in this module is to pass the provided CSP directly as a response header. However, in the case of using inline CSS (e.g. material-ui), we need to be able to set the inline nonce-${nonce}source for the style-src-elem. Is this functionality that you see this module taking on or should that be handled somewhere else?
Cheers!
Edit:
I felt I should add the workaround for any other folks that are encountering this - inside your specific gin handler, you can override the CSP header. So you'll need to:
Each page load should have new nonce generated.
The nonce provided in Content-Security-Policy header must match one used in <script nonce="xxx"> and <style nonce=>
@ttacon current workaround requires to do this in each route handler, correct?
Currently, the support for CSP in this module is to pass the provided CSP directly as a response header. However, in the case of using inline CSS (e.g. material-ui), we need to be able to set the inline
nonce-${nonce}
source for thestyle-src-elem
. Is this functionality that you see this module taking on or should that be handled somewhere else?Cheers!
Edit:
I felt I should add the workaround for any other folks that are encountering this - inside your specific gin handler, you can override the CSP header. So you'll need to:
nonce
to your HTML rendering function, as it must also be included as anmeta
attributed, i.e.:The text was updated successfully, but these errors were encountered: