Describe the bug
Actual behavior
When I use the username/password with got, It seems that the combo 'username:password' is encoded with encodeURI() before to be encode in base64 for the basic auth. This first encoding is not necessary due to the base64 encoding and brings problems. So when the encodeURI() change a value like '@' to '%40', the basic authentification doesn't work.
Expected behavior
Just encode the combo 'username:password' with base64 encoding.
Code to reproduce
const got = require('got');
(async () => {
const response = await got.head("http://example.com/", {username: "user@", password: "password@"});
console.info("Response:", response.client._httpMessage._header);
}) ();
We see that the Authorization header is invalid
Checklist
Describe the bug
Actual behavior
When I use the username/password with got, It seems that the combo 'username:password' is encoded with encodeURI() before to be encode in base64 for the basic auth. This first encoding is not necessary due to the base64 encoding and brings problems. So when the encodeURI() change a value like '@' to '%40', the basic authentification doesn't work.
Expected behavior
Just encode the combo 'username:password' with base64 encoding.
Code to reproduce
We see that the Authorization header is invalid
Checklist