http: decodes url.username and url.password for authorization header

This change properly decodes the url.username and url.password for
the authorization header constructed from the URL object for
http(s) requests.

Fixes: https://github.com/nodejs/node/issues/31439

PR-URL: https://github.com/nodejs/node/pull/39310
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Robert Nagy <ronagy@icloud.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
This commit is contained in:
Lew Gordon authored and Michaël Zasso committed 2021-09-04 15:14:39 +02:00
1 parent a437de3c5f
commit 2bc301dcff
4 files changed
+57 -1

No files matched your search

+4
View File
@@ -251,6 +251,10 @@ Global instance of [`https.Agent`][] for all HTTPS client requests.
<!-- YAML
added: v0.3.6
changes:
- version: REPLACEME
pr-url: https://github.com/nodejs/node/pull/39310
description: When using a `URL` object parsed username
and password will now be properly URI decoded.
- version: v14.1.0
pr-url: https://github.com/nodejs/node/pull/32786
description: The `highWaterMark` option is accepted now.