-
-
Notifications
You must be signed in to change notification settings - Fork 622
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
decodeURIComponent after parsing URL for initial connection #1384
Comments
which version are you using? I'd expect this issue would be fixed by #1360 Can you double check the version you have is v2.3.0? |
Thanks for your quick response! From my package.json: |
can you clarify |
It was the |
We might have to pass both username and password to > password = 'pass!@$%^&*+()\\word:'
'pass!@$%^&*+()\\word:'
> conn = new URL(`test://user:${password}@www.example.com/path`)
URL {
href: 'test://user:pass!%40$%%5E&*+()%5Cword%[email protected]/path',
origin: 'null',
protocol: 'test:',
username: 'user',
password: 'pass!%40$%%5E&*+()%5Cword%3A',
host: 'www.example.com',
hostname: 'www.example.com',
port: '',
pathname: '/path',
search: '',
searchParams: URLSearchParams {},
hash: ''
}
> decodeURIComponent(conn.password)
Uncaught URIError: URI malformed
at decodeURIComponent (<anonymous>)
> conn = new URL(`test://user:${encodeURIComponent(password)}@www.example.com/path`)
URL {
href: 'test://user:pass!%40%24%25%5E%26*%2B()%5Cword%[email protected]/path',
origin: 'null',
protocol: 'test:',
username: 'user',
password: 'pass!%40%24%25%5E%26*%2B()%5Cword%3A',
host: 'www.example.com',
hostname: 'www.example.com',
port: '',
pathname: '/path',
search: '',
searchParams: URLSearchParams {},
hash: ''
}
> decodeURIComponent(conn.password)
'pass!@$%^&*+()\\word:' So possible errors would have to be handled here and properly reported to the users, or we could try/catch and use I can open a PR to fix it when we determine which solution we want to use. |
can we just use |
(it's not just |
It appears the URL package is not decoding some special characters correctly. In my case, it was
@
sign used in the password.Regardless of whether
@
or%40
(its encoded counterpart) is used, the attributes obtained from parsed URL is still%40
.The text was updated successfully, but these errors were encountered: