Skip to content
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

fix(http): decode proxy url auth #5772

Closed
wants to merge 1 commit into from
Closed

Conversation

Thore1954
Copy link

#4852 introduced a subtle bug that recently broke one of our apps. Here's the issue:
Node's url.parse automatically decodes the auth property:

import url from 'url'
const myURL = url.parse('http://user%3F:pass%3F@localhost:4000')
console.log(myURL.auth) // "user?:pass?"

However, the URL interface returns username and password undecoded:

const myURL = new URL('http://user%3F:pass%3F@localhost:4000')
console.log(myURL.username) // "user%3F"
console.log(myURL.password) // "pass%3F"

This PR reintroduces the old behavior by manually decoding the username and password properties with decodeURIComponent.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant