diff --git a/gatsby-plugin-s3/src/bin.ts b/gatsby-plugin-s3/src/bin.ts index 00e8371..a4ddf73 100644 --- a/gatsby-plugin-s3/src/bin.ts +++ b/gatsby-plugin-s3/src/bin.ts @@ -300,7 +300,7 @@ export const deploy = async ({ yes, bucket, userAgent }: DeployArguments = {}) = uploadQueue.push( asyncify(async () => { const { fromPath, toPath: redirectPath } = redirect; - const redirectLocation = base ? resolveUrl(base, redirectPath) : redirectPath; + const redirectLocation = encodeURI(base ? resolveUrl(base, redirectPath) : redirectPath); let key = withoutLeadingSlash(fromPath); if (key.endsWith('/')) {