File tree 1 file changed +14
-2
lines changed
packages/gatsby-plugin-netlify/src
1 file changed +14
-2
lines changed Original file line number Diff line number Diff line change @@ -12,8 +12,18 @@ export default async function writeRedirectsFile(
12
12
13
13
const FILE_PATH = publicFolder ( `_redirects` )
14
14
15
- // Map redirect data to the format Netlify expects
16
15
// https://www.netlify.com/docs/redirects/
16
+ const NETLIFY_REDIRECT_KEYWORDS_ALLOWLIST = [
17
+ `query` ,
18
+ `conditions` ,
19
+ `headers` ,
20
+ `signed` ,
21
+ `edge_handler` ,
22
+ `Language` ,
23
+ `Country` ,
24
+ ]
25
+
26
+ // Map redirect data to the format Netlify expects
17
27
redirects = redirects . map ( redirect => {
18
28
const {
19
29
fromPath,
@@ -43,7 +53,9 @@ export default async function writeRedirectsFile(
43
53
`Values should not contain spaces.`
44
54
)
45
55
} else {
46
- pieces . push ( `${ key } =${ value } ` )
56
+ if ( NETLIFY_REDIRECT_KEYWORDS_ALLOWLIST . includes ( key ) ) {
57
+ pieces . push ( `${ key } =${ value } ` )
58
+ }
47
59
}
48
60
}
49
61
You can’t perform that action at this time.
0 commit comments