[Issue]: NVM not properly parsing credentials used for proxy authentication when a question mark is one of the password characters
bunglegrind opened this issue · 2 comments
What happened?
If I type
nvm proxy "http://username:password@127.0.0.1:8080"
proxy is correctly set:
nvm proxy
Current proxy: http://username:password@127.0.0.1:8080
But if I type
nvm proxy "http://username:pass?word@127.0.0.1:8080"
No proxy is set...
nvm proxy
Current proxy: none
What did you expect to happen?
I'm expecting, of course:
nvm proxy
Current proxy: http://username:pass?word@127.0.0.1:8080
Version
1.1.11 or newer (Default)
Which version of Windows?
Windows 10 (Default)
Which locale?
English (Default)
Which shell are you running NVM4W in?
PowerShell
User Permissions?
Standard User, Elevated
Is Developer Mode enabled?
None
Relevant log/console output
No response
Debug Output
No response
Anything else?
No response
To the best of my knowledge, question marks are not supported in the userinfo portion of a URL, according to RFC 3968. Question marks are a hierarchical identifier in a URL.
The supported syntax is:
authority = [ userinfo "@" ] host [ ":" port ]
where userinfo is further defined as:
userinfo = *( unreserved / pct-encoded / sub-delims / ":" )
A question mark is reserved, so it violated the unreserved
portion. However; you should be able to percent-encode it. In other words, you need to specify this as http://username:pass%3Fword@127.0.0.1:8080
. I haven't tested, but it should work.
sorry, my bad! Thanks a lot