strict-dynamic CSP support for hybrid Next.js apps #34582
-
Hi, I made a package However, the highlight of the package is strict-dynamic CSP support for hybrid Next.js apps on top, something that isn't feasible without middleware. It contains an easily reusable solution, that decides between a Nonce-based vs. a Hash-based approach for strict CSP on a per route basis. It is still in an early PoC state and I've been developing it from a private monorepo so far, but already got in touch with the maintainer of If you have a project going with Next 12 and have some time and room for experimentation, I'd be glad if you give it a try and give me some feedback on it! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Hey folks, wanted to swing back here with an update. After digging through many different issues and discussions, I've made a new page in the documentation (PR) specifically for Content Security Policy and nonces. This docs page:
Further, we've patched some bugs and made improvements to Really hope this helps out, thank you all 🙏 I'll be closing this discussion out. To continue the discussion, please go here. |
Beta Was this translation helpful? Give feedback.
Hey folks, wanted to swing back here with an update. After digging through many different issues and discussions, I've made a new page in the documentation (PR) specifically for Content Security Policy and nonces. This docs page:
nonce
with Middlewarenonce
in a route withheaders()
unsafe
nonce
Middleware from running on prefetches / static assetsFurther, we've patched some bugs and made improvements to
nonce
handling in Next.js that will be available in the latestcanary
version (for those of you time traveling from the future, upgrade to Next.js 13.5). We also …