Skip to content

Commit 34aa40e

Browse files
authored
build: update distribution (#4289)
1 parent 641099d commit 34aa40e

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
@@ -4511,7 +4511,7 @@ class HttpClient {
45114511
}
45124512
const usingSsl = parsedUrl.protocol === 'https:';
45134513
proxyAgent = new undici_1.ProxyAgent(Object.assign({ uri: proxyUrl.href, pipelining: !this._keepAlive ? 0 : 1 }, ((proxyUrl.username || proxyUrl.password) && {
4514-
token: `${proxyUrl.username}:${proxyUrl.password}`
4514+
token: `Basic ${Buffer.from(`${proxyUrl.username}:${proxyUrl.password}`).toString('base64')}`
45154515
})));
45164516
this._proxyAgentDispatcher = proxyAgent;
45174517
if (usingSsl && this._ignoreSslError) {
@@ -4625,11 +4625,11 @@ function getProxyUrl(reqUrl) {
46254625
})();
46264626
if (proxyVar) {
46274627
try {
4628-
return new URL(proxyVar);
4628+
return new DecodedURL(proxyVar);
46294629
}
46304630
catch (_a) {
46314631
if (!proxyVar.startsWith('http://') && !proxyVar.startsWith('https://'))
4632-
return new URL(`http://${proxyVar}`);
4632+
return new DecodedURL(`http://${proxyVar}`);
46334633
}
46344634
}
46354635
else {
@@ -4688,6 +4688,19 @@ function isLoopbackAddress(host) {
46884688
hostLower.startsWith('[::1]') ||
46894689
hostLower.startsWith('[0:0:0:0:0:0:0:1]'));
46904690
}
4691+
class DecodedURL extends URL {
4692+
constructor(url, base) {
4693+
super(url, base);
4694+
this._decodedUsername = decodeURIComponent(super.username);
4695+
this._decodedPassword = decodeURIComponent(super.password);
4696+
}
4697+
get username() {
4698+
return this._decodedUsername;
4699+
}
4700+
get password() {
4701+
return this._decodedPassword;
4702+
}
4703+
}
46914704
//# sourceMappingURL=proxy.js.map
46924705

46934706
/***/ }),

0 commit comments

Comments
 (0)