Runtime custom headers #21196
AnatoleLucet
started this conversation in
Ideas
Replies: 1 comment
-
Currently struggling with this as well. Context: we publish our application as a docker images and users should be able to configure CSP headers via environment variables. Currently they need to build the container from source in order to achieve this, it'd be nice to be able to configure this at runtime. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Describe the feature you'd like to request
I'd be nice to have a way to set custom headers at runtime via the Next config file.
Describe the solution you'd like
I think this should be en enhancement of the already existing
headers
function. I think this function should be reused/reinstantiated at runtime.For example, we're adding custom headers using some values from environment variables. Because the
headers
function is only called when building the site (or at least I guess it is), we can't change the headers' value without rebuilding the site.Describe alternatives you've considered
Currently, we're adding headers with an Express custom server.
Beta Was this translation helpful? Give feedback.
All reactions