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

Routing & Nonce Required #77

Open
fritterhoff opened this issue Oct 9, 2022 · 1 comment
Open

Routing & Nonce Required #77

fritterhoff opened this issue Oct 9, 2022 · 1 comment

Comments

@fritterhoff
Copy link

fritterhoff commented Oct 9, 2022

I'm trying to use this library in a project where several (sub-)pages require a nonce for inline styles. In case of loading the subpages directly the nonce is returned correctly and loading the pages works fine. In case of loading a statically rendered page before the server rendered page loading and applying the inline styles fails due to the lack of the nonce in the CSP header.

Is there (maybe) an option to enforce includint the nonce in the initial request, even it is not used directly? Due to the next.js routing the subpages are not "loaded" the same way as navigating to them with the direct URL...

To sum up:

  1. Loading a static rendered page: header does not include a nonce
  2. Loading a server rendered page via router "button" no new header is returned: nonce is missing and inline style fails

grafik

@fritterhoff
Copy link
Author

I've just build a mini showcase using MUI and the MUI datagrid: https://github.com/fritterhoff/csp-mui

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

No branches or pull requests

1 participant