-
Notifications
You must be signed in to change notification settings - Fork 0
/
next.config.js
39 lines (36 loc) · 882 Bytes
/
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
const { PHASE_DEVELOPMENT_SERVER } = require('next/constants');
let securityHeaders = [
{
key : 'Content-Security-Policy',
value: [
"default-src 'self' backend.nateconley.com www.google-analytics.com",
"script-src 'self' 'unsafe-inline' www.googletagmanager.com",
"style-src 'self' fonts.googleapis.com 'unsafe-inline'",
"font-src fonts.gstatic.com; object-src 'none'",
"img-src 'self' data: www.googletagmanager.com"
].join(';'),
},
];
module.exports = (phase, { defaultConfig }) => {
if (phase === PHASE_DEVELOPMENT_SERVER) {
return {
images: {
domains: [ 'backend.nateconley.com' ],
},
};
}
return {
images: {
domains: [ 'backend.nateconley.com' ],
},
async headers() {
return [
{
// Apply these headers to all routes in your application.
source: '/(.*)',
headers: securityHeaders,
},
]
},
}
}