Replies: 1 comment 3 replies
-
CSP can be delivered via an HTTP Header or a By using the So, |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Goals
metadata
object (or in the object returned by thegenerateMetadata
function)Non-Goals
Background
This was possible in the pages router.
This is necessary because :
When you build in SSG mode (
output: 'export'
), and you're not responsible for the hosting of the build (and hence have no way to configure the CSP headers), there should still be a way to set CSP rules, and there's no other way than through metadata (i.e. with<meta ...>
tags).When some pages need to have stricter CSP rules...
And I'm sure there are other examples.
Proposal
Simply add a key csp in the
metadata
object, and use it to fill the tag<meta http-equiv="Content-Security-Policy" content="..." />
Beta Was this translation helpful? Give feedback.
All reactions