Skip to content

Commit ca0c7fa

Browse files
feat: add security headers configuration to next.js
1 parent 2b607ed commit ca0c7fa

1 file changed

Lines changed: 19 additions & 1 deletion

File tree

next.config.mjs

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,22 @@
11
/** @type {import('next').NextConfig} */
2-
const nextConfig = {};
2+
const nextConfig = {
3+
async headers(){
4+
return [
5+
{
6+
source: '/(.*)',
7+
headers: [
8+
{
9+
key:'strict-transport-security',
10+
value:'max-age=31536000; includeSubDomains; preload'
11+
},
12+
{
13+
key:'x-frame-options',
14+
value:'SAMEORIGIN'
15+
}
16+
]
17+
}
18+
]
19+
}
20+
};
321

422
export default nextConfig;

0 commit comments

Comments
 (0)