Skip to content

Commit c57414f

Browse files
committed
Freshen generated index.js file.
1 parent 5476792 commit c57414f

File tree

1 file changed

+16
-3
lines changed

1 file changed

+16
-3
lines changed

dist/index.js

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1649,7 +1649,7 @@ class HttpClient {
16491649
}
16501650
const usingSsl = parsedUrl.protocol === 'https:';
16511651
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')}`
16531653
})));
16541654
this._proxyAgentDispatcher = proxyAgent;
16551655
if (usingSsl && this._ignoreSslError) {
@@ -1763,11 +1763,11 @@ function getProxyUrl(reqUrl) {
17631763
})();
17641764
if (proxyVar) {
17651765
try {
1766-
return new URL(proxyVar);
1766+
return new DecodedURL(proxyVar);
17671767
}
17681768
catch (_a) {
17691769
if (!proxyVar.startsWith('http://') && !proxyVar.startsWith('https://'))
1770-
return new URL(`http://${proxyVar}`);
1770+
return new DecodedURL(`http://${proxyVar}`);
17711771
}
17721772
}
17731773
else {
@@ -1826,6 +1826,19 @@ function isLoopbackAddress(host) {
18261826
hostLower.startsWith('[::1]') ||
18271827
hostLower.startsWith('[0:0:0:0:0:0:0:1]'));
18281828
}
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+
}
18291842
//# sourceMappingURL=proxy.js.map
18301843

18311844
/***/ }),

0 commit comments

Comments
 (0)