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

decodeURIComponent basic auth #1249

Closed
2 tasks done
stevenvachon opened this issue May 11, 2020 · 1 comment
Closed
2 tasks done

decodeURIComponent basic auth #1249

stevenvachon opened this issue May 11, 2020 · 1 comment

Comments

@stevenvachon
Copy link
Contributor

stevenvachon commented May 11, 2020

Describe the bug

  • Got version: 11.1.3
  • Node.js version: 12.16.3 and 14.2.0
  • OS & version: macOS 10.15.4

Similar to #1234, basic auth values are not decoded before sending to http.request, resulting in authentication failure.

Code to reproduce

These send "%3Duser" and "%3Dpass" to http.request:

const url = new URL('http://host');
url.username = '=user';
url.password = '=pass';
got(new URL(url));
got({
  password: '=user',
  url: 'http://host',
  username: '=user'
});
const url = new URL('http://host');
got(`${url.protocol}//=user:=pass@${url.host}`);

Checklist

  • I have read the documentation.
  • I have tried my code with the latest version of Node.js and Got.
@stevenvachon stevenvachon changed the title decodeURIComponent basic auth for WHATWG URLs decodeURIComponent basic auth May 11, 2020
@szmarczak
Copy link
Collaborator

Duplicate of #1169

@szmarczak szmarczak marked this as a duplicate of #1169 May 11, 2020
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

No branches or pull requests

2 participants