-
Notifications
You must be signed in to change notification settings - Fork 3
/
constants.js
48 lines (43 loc) · 1.02 KB
/
constants.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
/**
* Plugin values
*/
const DEFAULT_CONFIG = {
// add more headers
headers: {},
// turn off the default security headers
mergeSecurityHeaders: true,
// turn off the default caching headers
mergeCachingHeaders: true,
// optional transform for manipulating headers under each path (e.g.sorting), etc.
transformHeaders: (headers, path) => headers,
// add redirects
redirects: []
}
const DEFAULT_HEADER_VALUES = {
from: null,
to: null,
status: 301,
force: false,
query: {},
conditions: {}
}
const SECURITY_HEADERS = {
'/*': [
'Referrer-Policy: origin',
'X-Content-Type-Options: nosniff',
'X-Frame-Options: DENY',
'X-XSS-Protection: 1; mode=block'
]
}
const CACHING_HEADERS = {
'/_nuxt/*': ['Cache-Control: public, max-age=31536000, immutable'],
'/sw.js': ['Cache-Control: no-cache']
}
const FILE_COMMENT = '## Created with https://github.com/bazzite/nuxt-netlify\n'
module.exports = {
DEFAULT_CONFIG,
DEFAULT_HEADER_VALUES,
SECURITY_HEADERS,
CACHING_HEADERS,
FILE_COMMENT
}