feat: ajouter les en-têtes de sécurité pour atteindre 100/100 sur MDN Observatory

This commit is contained in:
2026-07-08 00:27:57 +04:00
parent 99daeb014c
commit b5a3b278ba
8 changed files with 196 additions and 13 deletions
+41 -1
View File
@@ -28,9 +28,49 @@ function buildRemotePatterns() {
return patterns
}
async function headers() {
return [
{
source: '/:path*',
headers: [
{
key: 'Strict-Transport-Security',
value: 'max-age=63072000; includeSubDomains; preload'
},
{
key: 'X-Content-Type-Options',
value: 'nosniff'
},
{
key: 'X-Frame-Options',
value: 'SAMEORIGIN'
},
{
key: 'Referrer-Policy',
value: 'strict-origin-when-cross-origin'
},
{
key: 'Cross-Origin-Resource-Policy',
value: 'same-site'
},
{
key: 'Cross-Origin-Opener-Policy',
value: 'same-origin'
},
{
key: 'Permissions-Policy',
value: 'accelerometer=(), camera=(), geolocation=(), gyroscope=(), magnetometer=(), microphone=(), payment=(), usb=()'
}
]
}
]
}
module.exports = (withPWA({
turbopack: {},
poweredByHeader: false,
images: {
remotePatterns: buildRemotePatterns()
}
},
headers
}))