@@ -1649,7 +1649,7 @@ class HttpClient {
1649
1649
}
1650
1650
const usingSsl = parsedUrl.protocol === 'https:';
1651
1651
proxyAgent = new undici_1.ProxyAgent(Object.assign({ uri: proxyUrl.href, pipelining: !this._keepAlive ? 0 : 1 }, ((proxyUrl.username || proxyUrl.password) && {
1652
- token: `${ proxyUrl.username}:${proxyUrl.password}`
1652
+ token: `Basic ${Buffer.from(`${ proxyUrl.username}:${proxyUrl.password}`).toString('base64') }`
1653
1653
})));
1654
1654
this._proxyAgentDispatcher = proxyAgent;
1655
1655
if (usingSsl && this._ignoreSslError) {
@@ -1763,11 +1763,11 @@ function getProxyUrl(reqUrl) {
1763
1763
})();
1764
1764
if (proxyVar) {
1765
1765
try {
1766
- return new URL (proxyVar);
1766
+ return new DecodedURL (proxyVar);
1767
1767
}
1768
1768
catch (_a) {
1769
1769
if (!proxyVar.startsWith('http://') && !proxyVar.startsWith('https://'))
1770
- return new URL (`http://${proxyVar}`);
1770
+ return new DecodedURL (`http://${proxyVar}`);
1771
1771
}
1772
1772
}
1773
1773
else {
@@ -1826,6 +1826,19 @@ function isLoopbackAddress(host) {
1826
1826
hostLower.startsWith('[::1]') ||
1827
1827
hostLower.startsWith('[0:0:0:0:0:0:0:1]'));
1828
1828
}
1829
+ class DecodedURL extends URL {
1830
+ constructor(url, base) {
1831
+ super(url, base);
1832
+ this._decodedUsername = decodeURIComponent(super.username);
1833
+ this._decodedPassword = decodeURIComponent(super.password);
1834
+ }
1835
+ get username() {
1836
+ return this._decodedUsername;
1837
+ }
1838
+ get password() {
1839
+ return this._decodedPassword;
1840
+ }
1841
+ }
1829
1842
//# sourceMappingURL=proxy.js.map
1830
1843
1831
1844
/***/ }),
0 commit comments