Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 31 additions & 0 deletions next.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@
});

if (!options.isServer) {
config.resolve.fallback.fs = false;

Check warning on line 73 in next.config.js

View workflow job for this annotation

GitHub Actions / Verify Files

Assignment to property of function parameter 'config'
}

if (options.isServer) {
Expand Down Expand Up @@ -105,6 +105,37 @@

return config;
},
async headers() {
return [
{
source: '/:path*',
headers: [
{
key: 'Strict-Transport-Security',
// `preload` is deliberately omitted: submitting to the preload list is
// effectively irreversible. Add it only after confirming every
// subdomain is HTTPS-only and you intend to submit.
value: 'max-age=31536000; includeSubDomains',
},
{key: 'X-Content-Type-Options', value: 'nosniff'},
{
key: 'X-Frame-Options',
// Must stay SAMEORIGIN, not DENY: SandboxBlock embeds
// `${window.location.origin}/sandbox/<libId>/<componentId>` in an iframe
// on every component page, and DENY blocks same-origin framing too.
value: 'SAMEORIGIN',
},
{key: 'Referrer-Policy', value: 'strict-origin-when-cross-origin'},
{
key: 'Permissions-Policy',
value: 'camera=(), microphone=(), geolocation=()',
},
],
},
];
},
// Drops the `X-Powered-By: Next.js` version-disclosure header.
poweredByHeader: false,
reactStrictMode: true,
// The theme builder route was renamed /themer -> /themes; keep old
// links and indexed URLs working with a permanent redirect.
Expand Down
Loading