-
Notifications
You must be signed in to change notification settings - Fork 0
/
next.config.js
63 lines (59 loc) · 1.78 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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
/** @type {import('next').NextConfig} */
const nextConfig = {
reactStrictMode: true,
swcMinify: true,
}
const ContentSecurityPolicy = `
default-src 'self';
script-src 'self';
connect-src 'self' https://cognito-idp.eu-west-2.amazonaws.com/ https://cognito-identity.eu-west-2.amazonaws.com https://vcjfyfujgnafzidkrjmnsdwuai.appsync-api.eu-west-2.amazonaws.com/graphql https://fr46ydrsrra53jtay5oxtuxxq4.appsync-api.eu-west-2.amazonaws.com/graphql https://o1400007.ingest.sentry.io;
img-src 'self' data: https://d2ez6lox3k9lt0.cloudfront.net https://d26u7w064jxl38.cloudfront.net;
media-src 'self' https://d2ez6lox3k9lt0.cloudfront.net https://d26u7w064jxl38.cloudfront.net;
style-src 'self' https://fonts.googleapis.com;
font-src 'self' https://fonts.gstatic.com;
`
const securityHeaders = [
{
key: 'X-XSS-Protection',
value: '1; mode=block'
},
{
key: 'X-Frame-Options',
value: 'SAMEORIGIN'
},
{
key: 'X-Content-Type-Options',
value: 'nosniff'
},
{
key: 'Permissions-Policy',
value: 'camera=(), microphone=(), geolocation=(), browsing-topics=()'
},
{
key: 'Referrer-Policy',
value: 'strict-origin'
},
{
key: 'Content-Security-Policy',
value: ContentSecurityPolicy.replace(/\s{2,}/g, ' ').trim()
}
]
module.exports = {
async headers() {
return [
{
// Apply these headers to all routes in your application.
source: '/:path*',
headers: securityHeaders,
},
]
},
webpack(config) {
config.module.rules.push({
test: /\.svg$/i,
issuer: /\.[jt]sx?$/,
use: ['@svgr/webpack']
})
return config
},
}