-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathnext.config.js
48 lines (37 loc) · 1 KB
/
next.config.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
/** @type {import('next').NextConfig} */
const withPWA = require('next-pwa')({
dest: "public",
register: true,
skipWaiting: true,
buildExcludes: [/chunks\/images\/.*$/],
disable: process.env.NODE_ENV === 'development'
})
const securityHeaders = [
//Informs the browser that this page should only access pages using HTTPS
//Blocks access to websites that can only be served over HTTP
{
key: 'Strict-Transport-Security',
value: 'max-age=63072000; includeSubDomains; preload'
},
//Prevents page from loading if it detects XSS attacks
//Can be used for legacy browsers that don't support CSP
{
key: 'X-XSS-Protection',
value: '1; mode=block'
}
]
module.exports = withPWA({
reactStrictMode: true,
images: {
domains: [ 'diamondapp.com', 'ancient-reef-76919.herokuapp.com'],
},
async headers(){
return [
{
// Apply these headers to all routes in your application.
source: '/:path*',
headers: securityHeaders,
}
]
}
})