You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Library erroneously URI-encodes usersname and password #2093
When Got builds an Authorization header for basic auth, it URI-encodes the username and password. This is not warranted by any spec, and it breaks requests that use special characters in their username or password.
Actual behavior
Got URI-encodes the username and password used in the Authorization header for basic auth.
Expected behavior
Got should send whatever username or password is specified by the user, without modification.
I can reproduce the bug in v11.8.5, but not v12.3.0. I can't upgrade to version 12 because using ES modules would require an entire refactor of our build system.
Activity
szmarczak commentedon Jul 28, 2022
got/source/core/options.ts
Lines 1842 to 1883 in e032b60
got/source/core/index.ts
Line 1044 in e032b60
got/source/core/index.ts
Lines 1060 to 1063 in e032b60
show otherwise. Can you please post an actual code to reproduce the issue? The one you posted isn't valid.
JoshuaWise commentedon Jul 28, 2022
I can reproduce the bug in v11.8.5, but not v12.3.0. I can't upgrade to version 12 because using ES modules would require an entire refactor of our build system.
JoshuaWise commentedon Jul 28, 2022
Here's how to reproduce:
It outputs:
szmarczak commentedon Jul 29, 2022
got/source/core/index.ts
Lines 1690 to 1702 in 5e17bb7
In Got v11 we don't do any special handling. The bug is in upstream, see nodejs/node#31450
Duplicate of #1169