gatsby-uc / gatsby-plugin-s3

Deploy your gatsby site to a S3 bucket.
https://gatsby-plugin-s3.jari.io/
MIT License
210 stars 110 forks source link

fix: resolve redirect paths containing non-ascii characters #439

Open me4502 opened 1 year ago

me4502 commented 1 year ago

When using non-ascii characters in a URL, the redirect path fails upon upload. This encodes the URI to use encoded path symbols. For non-ascii paths this will make no change

YoshiWalsh commented 1 year ago

Thanks for contributing!

I haven't had a chance to test this yet, but would it be better to call encodeURIComponent on redirectPath instead? Is it possible that redirectPath might contain characters such as "#" or "?", and if it does should these also be escaped?

How are your redirects being generated that they contain non-ASCII characters, is toPath always unencoded? Or are there situations where this change might result in double encoding?