@@ -2578,7 +2578,7 @@ class HttpClient {
2578
2578
}
2579
2579
const usingSsl = parsedUrl.protocol === 'https:';
2580
2580
proxyAgent = new undici_1.ProxyAgent(Object.assign({ uri: proxyUrl.href, pipelining: !this._keepAlive ? 0 : 1 }, ((proxyUrl.username || proxyUrl.password) && {
2581
- token: `${ proxyUrl.username}:${proxyUrl.password}`
2581
+ token: `Basic ${Buffer.from(`${ proxyUrl.username}:${proxyUrl.password}`).toString('base64') }`
2582
2582
})));
2583
2583
this._proxyAgentDispatcher = proxyAgent;
2584
2584
if (usingSsl && this._ignoreSslError) {
@@ -2692,11 +2692,11 @@ function getProxyUrl(reqUrl) {
2692
2692
})();
2693
2693
if (proxyVar) {
2694
2694
try {
2695
- return new URL (proxyVar);
2695
+ return new DecodedURL (proxyVar);
2696
2696
}
2697
2697
catch (_a) {
2698
2698
if (!proxyVar.startsWith('http://') && !proxyVar.startsWith('https://'))
2699
- return new URL (`http://${proxyVar}`);
2699
+ return new DecodedURL (`http://${proxyVar}`);
2700
2700
}
2701
2701
}
2702
2702
else {
@@ -2755,6 +2755,19 @@ function isLoopbackAddress(host) {
2755
2755
hostLower.startsWith('[::1]') ||
2756
2756
hostLower.startsWith('[0:0:0:0:0:0:0:1]'));
2757
2757
}
2758
+ class DecodedURL extends URL {
2759
+ constructor(url, base) {
2760
+ super(url, base);
2761
+ this._decodedUsername = decodeURIComponent(super.username);
2762
+ this._decodedPassword = decodeURIComponent(super.password);
2763
+ }
2764
+ get username() {
2765
+ return this._decodedUsername;
2766
+ }
2767
+ get password() {
2768
+ return this._decodedPassword;
2769
+ }
2770
+ }
2758
2771
//# sourceMappingURL=proxy.js.map
2759
2772
2760
2773
/***/ }),
0 commit comments