Describe the bug
if I have a leading space in a redirect, the redirect doesn't work.
This was obviously an issue caused by user error but I unexpectedly lost a lot of time on this cursed space. I believe this would be a quick win to resolve these typos issues by trimming the URI as they are known to not match the URI spec. If there is more nuance here than I am unaware of (most likely), then we should be able to trim reliably if the redirect trimmed redirect starts with ^http[s]?:\/\/
Steps to reproduce
Use a leading space in the to field of a redirect.
[[redirects]]
from = "/test"
to = " https://www.netlify.com"
status = 200
Configuration
see steps to repro
Environment
System:
OS: macOS 12.4
CPU: (10) arm64 Apple M1 Pro
Memory: 3.74 GB / 32.00 GB
Shell: 5.8.1 - /bin/zsh
Binaries:
Node: 16.13.1 - /opt/homebrew/opt/nvm/versions/node/v16.13.1/bin/node
Yarn: 1.22.17 - /opt/homebrew/opt/nvm/versions/node/v16.13.1/bin/yarn
npm: 8.1.2 - /opt/homebrew/opt/nvm/versions/node/v16.13.1/bin/npm
npmGlobalPackages:
netlify-cli: 10.3.1
Describe the bug
if I have a leading space in a redirect, the redirect doesn't work.
This was obviously an issue caused by user error but I unexpectedly lost a lot of time on this cursed space. I believe this would be a quick win to resolve these typos issues by trimming the URI as they are known to not match the URI spec. If there is more nuance here than I am unaware of (most likely), then we should be able to trim reliably if the redirect trimmed redirect starts with
^http[s]?:\/\/Steps to reproduce
Use a leading space in the
tofield of a redirect.Configuration
see steps to repro
Environment