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

No way to set nonce on inline script for Content Security Policy #401

Closed
fierysolid opened this issue Dec 11, 2024 · 3 comments
Closed

No way to set nonce on inline script for Content Security Policy #401

fierysolid opened this issue Dec 11, 2024 · 3 comments

Comments

@fierysolid
Copy link

The ApolloNextAppProvider creates an inline script during SSR that is meant to set the ApolloSSRDataTransport property on the window, but with a strict CSP and 'unsafe-inline' disabled, there is no way to attach the script-src nonce to this inline script.

The nonce is set in the x-nonce request header and NextJS uses this to set the nonce on all of the inline scripts it creates. Can we also grab this header and attach it to the inline script being created by apollo?

@fierysolid
Copy link
Author

JK I found the extraScriptProps

Copy link
Contributor

Do you have any feedback for the maintainers? Please tell us by taking a one-minute survey. Your responses will help us understand Apollo Client usage and allow us to serve you better.

@phryneas
Copy link
Member

Glad you found it!

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

2 participants