mirror of
https://github.com/luxfi/explore.git
synced 2026-07-27 05:54:15 +00:00
envs.js is generated at container startup from environment variables. Add Cache-Control: no-store header to ensure CDN/browser never serves a stale version when config changes.
47 lines
1.0 KiB
JavaScript
47 lines
1.0 KiB
JavaScript
async function headers() {
|
|
return [
|
|
{
|
|
// envs.js is generated at container startup — must never be cached
|
|
source: '/assets/envs.js',
|
|
headers: [
|
|
{
|
|
key: 'Cache-Control',
|
|
value: 'no-store, no-cache, must-revalidate',
|
|
},
|
|
],
|
|
},
|
|
{
|
|
source: '/:path*',
|
|
headers: [
|
|
// security headers from here - https://nextjs.org/docs/advanced-features/security-headers
|
|
{
|
|
key: 'X-Frame-Options',
|
|
value: 'SAMEORIGIN',
|
|
},
|
|
{
|
|
key: 'X-Content-Type-Options',
|
|
value: 'nosniff',
|
|
},
|
|
{
|
|
key: 'X-XSS-Protection',
|
|
value: '1; mode=block',
|
|
},
|
|
{
|
|
key: 'X-DNS-Prefetch-Control',
|
|
value: 'on',
|
|
},
|
|
{
|
|
key: 'Cross-Origin-Opener-Policy',
|
|
value: 'same-origin',
|
|
},
|
|
{
|
|
key: 'Referrer-Policy',
|
|
value: 'origin-when-cross-origin',
|
|
},
|
|
],
|
|
},
|
|
];
|
|
}
|
|
|
|
module.exports = headers;
|