Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat/security headers #4842

Merged
merged 8 commits into from
Dec 3, 2024
Merged
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
29 changes: 28 additions & 1 deletion next.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -148,11 +148,38 @@ const moduleExports = withBundleAnalyzer({
locales,
defaultLocale,
},
headers: () => {
headers: async () => {
kkatusic marked this conversation as resolved.
Show resolved Hide resolved
return [
{
source: '/:path*',
locale: false,
headers: [
{
key: 'X-Frame-Options',
value: 'SAMEORIGIN',
},
{
key: 'Content-Security-Policy',
value: "frame-ancestors 'self'",
},
{
key: 'X-Content-Type-Options',
value: 'nosniff', // Mitigates MIME type sniffing
},
{
key: 'Referrer-Policy',
value: 'strict-origin-when-cross-origin', // Protects user privacy
},
{
key: 'Permissions-Policy',
value: 'camera=(), microphone=(), geolocation=()', // Limits usage of browser features
},
],
},
{
// Adding CORS headers for /manifest.json
source: '/manifest.json',
locale: false,
headers: [
{
key: 'Access-Control-Allow-Origin',
Expand Down
Loading