From 6b9af774ef6a7346bbf7f7009aa3bdf03a917065 Mon Sep 17 00:00:00 2001 From: Damian Stasik Date: Wed, 16 Oct 2019 15:11:28 +0200 Subject: [PATCH 1/2] fix(gatsby-plugin-netlify): cast `status` to string --- packages/gatsby-plugin-netlify/src/create-redirects.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/gatsby-plugin-netlify/src/create-redirects.js b/packages/gatsby-plugin-netlify/src/create-redirects.js index 600dc95ebc1c7..fcf2c4fa08b78 100644 --- a/packages/gatsby-plugin-netlify/src/create-redirects.js +++ b/packages/gatsby-plugin-netlify/src/create-redirects.js @@ -28,7 +28,7 @@ export default async function writeRedirectsFile( let status = isPermanent ? `301` : `302` if (statusCode) status = statusCode - if (force) status = status.concat(`!`) + if (force) status = `${status}!` // The order of the first 3 parameters is significant. // The order for rest params (key-value pairs) is arbitrary. From 1802b6626791629bb86bac1a2c4a5086bb59d43f Mon Sep 17 00:00:00 2001 From: Damian Stasik Date: Wed, 16 Oct 2019 16:23:20 +0200 Subject: [PATCH 2/2] Update create-redirects.js --- packages/gatsby-plugin-netlify/src/create-redirects.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/gatsby-plugin-netlify/src/create-redirects.js b/packages/gatsby-plugin-netlify/src/create-redirects.js index fcf2c4fa08b78..ddfd425ae3e62 100644 --- a/packages/gatsby-plugin-netlify/src/create-redirects.js +++ b/packages/gatsby-plugin-netlify/src/create-redirects.js @@ -26,7 +26,7 @@ export default async function writeRedirectsFile( } = redirect let status = isPermanent ? `301` : `302` - if (statusCode) status = statusCode + if (statusCode) status = String(statusCode) if (force) status = `${status}!`