File tree Expand file tree Collapse file tree 1 file changed +14
-2
lines changed
packages/gatsby-plugin-netlify/src Expand file tree Collapse file tree 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(
1212
1313 const FILE_PATH = publicFolder ( `_redirects` )
1414
15- // Map redirect data to the format Netlify expects
1615 // 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
1727 redirects = redirects . map ( redirect => {
1828 const {
1929 fromPath,
@@ -43,7 +53,9 @@ export default async function writeRedirectsFile(
4353 `Values should not contain spaces.`
4454 )
4555 } else {
46- pieces . push ( `${ key } =${ value } ` )
56+ if ( NETLIFY_REDIRECT_KEYWORDS_ALLOWLIST . includes ( key ) ) {
57+ pieces . push ( `${ key } =${ value } ` )
58+ }
4759 }
4860 }
4961
You can’t perform that action at this time.
0 commit comments