mirror of
https://github.com/astral-sh/setup-uv.git
synced 2026-09-21 12:28:49 +00:00
+23
-34
@@ -8542,7 +8542,7 @@ var require_proxy_agent = __commonJS({
|
||||
return this.#client.destroy(err);
|
||||
}
|
||||
};
|
||||
var ProxyAgent3 = class extends DispatcherBase {
|
||||
var ProxyAgent2 = class extends DispatcherBase {
|
||||
constructor(opts) {
|
||||
super();
|
||||
if (!opts || typeof opts === "object" && !(opts instanceof URL2) && !opts.uri) {
|
||||
@@ -8683,7 +8683,7 @@ var require_proxy_agent = __commonJS({
|
||||
throw new InvalidArgumentError("Proxy-Authorization should be sent in ProxyAgent constructor");
|
||||
}
|
||||
}
|
||||
module2.exports = ProxyAgent3;
|
||||
module2.exports = ProxyAgent2;
|
||||
}
|
||||
});
|
||||
|
||||
@@ -8693,14 +8693,14 @@ var require_env_http_proxy_agent = __commonJS({
|
||||
"use strict";
|
||||
var DispatcherBase = require_dispatcher_base();
|
||||
var { kClose, kDestroy, kClosed, kDestroyed, kDispatch, kNoProxyAgent, kHttpProxyAgent, kHttpsProxyAgent } = require_symbols();
|
||||
var ProxyAgent3 = require_proxy_agent();
|
||||
var ProxyAgent2 = require_proxy_agent();
|
||||
var Agent = require_agent();
|
||||
var DEFAULT_PORTS = {
|
||||
"http:": 80,
|
||||
"https:": 443
|
||||
};
|
||||
var experimentalWarned = false;
|
||||
var EnvHttpProxyAgent = class extends DispatcherBase {
|
||||
var EnvHttpProxyAgent2 = class extends DispatcherBase {
|
||||
#noProxyValue = null;
|
||||
#noProxyEntries = null;
|
||||
#opts = null;
|
||||
@@ -8717,13 +8717,13 @@ var require_env_http_proxy_agent = __commonJS({
|
||||
this[kNoProxyAgent] = new Agent(agentOpts);
|
||||
const HTTP_PROXY = httpProxy ?? process.env.http_proxy ?? process.env.HTTP_PROXY;
|
||||
if (HTTP_PROXY) {
|
||||
this[kHttpProxyAgent] = new ProxyAgent3({ ...agentOpts, uri: HTTP_PROXY });
|
||||
this[kHttpProxyAgent] = new ProxyAgent2({ ...agentOpts, uri: HTTP_PROXY });
|
||||
} else {
|
||||
this[kHttpProxyAgent] = this[kNoProxyAgent];
|
||||
}
|
||||
const HTTPS_PROXY = httpsProxy ?? process.env.https_proxy ?? process.env.HTTPS_PROXY;
|
||||
if (HTTPS_PROXY) {
|
||||
this[kHttpsProxyAgent] = new ProxyAgent3({ ...agentOpts, uri: HTTPS_PROXY });
|
||||
this[kHttpsProxyAgent] = new ProxyAgent2({ ...agentOpts, uri: HTTPS_PROXY });
|
||||
} else {
|
||||
this[kHttpsProxyAgent] = this[kHttpProxyAgent];
|
||||
}
|
||||
@@ -8819,7 +8819,7 @@ var require_env_http_proxy_agent = __commonJS({
|
||||
return process.env.no_proxy ?? process.env.NO_PROXY ?? "";
|
||||
}
|
||||
};
|
||||
module2.exports = EnvHttpProxyAgent;
|
||||
module2.exports = EnvHttpProxyAgent2;
|
||||
}
|
||||
});
|
||||
|
||||
@@ -18454,8 +18454,8 @@ var require_undici = __commonJS({
|
||||
var Pool = require_pool();
|
||||
var BalancedPool = require_balanced_pool();
|
||||
var Agent = require_agent();
|
||||
var ProxyAgent3 = require_proxy_agent();
|
||||
var EnvHttpProxyAgent = require_env_http_proxy_agent();
|
||||
var ProxyAgent2 = require_proxy_agent();
|
||||
var EnvHttpProxyAgent2 = require_env_http_proxy_agent();
|
||||
var RetryAgent = require_retry_agent();
|
||||
var errors = require_errors();
|
||||
var util = require_util();
|
||||
@@ -18477,8 +18477,8 @@ var require_undici = __commonJS({
|
||||
module2.exports.Pool = Pool;
|
||||
module2.exports.BalancedPool = BalancedPool;
|
||||
module2.exports.Agent = Agent;
|
||||
module2.exports.ProxyAgent = ProxyAgent3;
|
||||
module2.exports.EnvHttpProxyAgent = EnvHttpProxyAgent;
|
||||
module2.exports.ProxyAgent = ProxyAgent2;
|
||||
module2.exports.EnvHttpProxyAgent = EnvHttpProxyAgent2;
|
||||
module2.exports.RetryAgent = RetryAgent;
|
||||
module2.exports.RetryHandler = RetryHandler;
|
||||
module2.exports.DecoratorHandler = DecoratorHandler;
|
||||
@@ -31050,7 +31050,7 @@ var require_proxy_agent2 = __commonJS({
|
||||
return this.#client.destroy(err);
|
||||
}
|
||||
};
|
||||
var ProxyAgent3 = class extends DispatcherBase {
|
||||
var ProxyAgent2 = class extends DispatcherBase {
|
||||
constructor(opts) {
|
||||
if (!opts || typeof opts === "object" && !(opts instanceof URL) && !opts.uri) {
|
||||
throw new InvalidArgumentError("Proxy uri is mandatory");
|
||||
@@ -31249,7 +31249,7 @@ var require_proxy_agent2 = __commonJS({
|
||||
function throwProxyAuthError() {
|
||||
throw new InvalidArgumentError("Proxy-Authorization should be sent in ProxyAgent constructor");
|
||||
}
|
||||
module2.exports = ProxyAgent3;
|
||||
module2.exports = ProxyAgent2;
|
||||
}
|
||||
});
|
||||
|
||||
@@ -31259,13 +31259,13 @@ var require_env_http_proxy_agent2 = __commonJS({
|
||||
"use strict";
|
||||
var DispatcherBase = require_dispatcher_base2();
|
||||
var { kClose, kDestroy, kClosed, kDestroyed, kDispatch, kNoProxyAgent, kHttpProxyAgent, kHttpsProxyAgent } = require_symbols6();
|
||||
var ProxyAgent3 = require_proxy_agent2();
|
||||
var ProxyAgent2 = require_proxy_agent2();
|
||||
var Agent = require_agent2();
|
||||
var DEFAULT_PORTS = {
|
||||
"http:": 80,
|
||||
"https:": 443
|
||||
};
|
||||
var EnvHttpProxyAgent = class extends DispatcherBase {
|
||||
var EnvHttpProxyAgent2 = class extends DispatcherBase {
|
||||
#noProxyValue = null;
|
||||
#noProxyEntries = null;
|
||||
#opts = null;
|
||||
@@ -31276,13 +31276,13 @@ var require_env_http_proxy_agent2 = __commonJS({
|
||||
this[kNoProxyAgent] = new Agent(agentOpts);
|
||||
const HTTP_PROXY = httpProxy ?? process.env.http_proxy ?? process.env.HTTP_PROXY;
|
||||
if (HTTP_PROXY) {
|
||||
this[kHttpProxyAgent] = new ProxyAgent3({ ...agentOpts, uri: HTTP_PROXY });
|
||||
this[kHttpProxyAgent] = new ProxyAgent2({ ...agentOpts, uri: HTTP_PROXY });
|
||||
} else {
|
||||
this[kHttpProxyAgent] = this[kNoProxyAgent];
|
||||
}
|
||||
const HTTPS_PROXY = httpsProxy ?? process.env.https_proxy ?? process.env.HTTPS_PROXY;
|
||||
if (HTTPS_PROXY) {
|
||||
this[kHttpsProxyAgent] = new ProxyAgent3({ ...agentOpts, uri: HTTPS_PROXY });
|
||||
this[kHttpsProxyAgent] = new ProxyAgent2({ ...agentOpts, uri: HTTPS_PROXY });
|
||||
} else {
|
||||
this[kHttpsProxyAgent] = this[kHttpProxyAgent];
|
||||
}
|
||||
@@ -31383,7 +31383,7 @@ var require_env_http_proxy_agent2 = __commonJS({
|
||||
return process.env.no_proxy ?? process.env.NO_PROXY ?? "";
|
||||
}
|
||||
};
|
||||
module2.exports = EnvHttpProxyAgent;
|
||||
module2.exports = EnvHttpProxyAgent2;
|
||||
}
|
||||
});
|
||||
|
||||
@@ -46513,9 +46513,9 @@ var require_undici2 = __commonJS({
|
||||
var RoundRobinPool = require_round_robin_pool();
|
||||
var Agent = require_agent2();
|
||||
var Dispatcher1Wrapper = require_dispatcher1_wrapper();
|
||||
var ProxyAgent3 = require_proxy_agent2();
|
||||
var ProxyAgent2 = require_proxy_agent2();
|
||||
var Socks5ProxyAgent = require_socks5_proxy_agent();
|
||||
var EnvHttpProxyAgent = require_env_http_proxy_agent2();
|
||||
var EnvHttpProxyAgent2 = require_env_http_proxy_agent2();
|
||||
var RetryAgent = require_retry_agent2();
|
||||
var H2CClient = require_h2c_client();
|
||||
var errors = require_errors2();
|
||||
@@ -46541,9 +46541,9 @@ var require_undici2 = __commonJS({
|
||||
module2.exports.RoundRobinPool = RoundRobinPool;
|
||||
module2.exports.Agent = Agent;
|
||||
module2.exports.Dispatcher1Wrapper = Dispatcher1Wrapper;
|
||||
module2.exports.ProxyAgent = ProxyAgent3;
|
||||
module2.exports.ProxyAgent = ProxyAgent2;
|
||||
module2.exports.Socks5ProxyAgent = Socks5ProxyAgent;
|
||||
module2.exports.EnvHttpProxyAgent = EnvHttpProxyAgent;
|
||||
module2.exports.EnvHttpProxyAgent = EnvHttpProxyAgent2;
|
||||
module2.exports.RetryAgent = RetryAgent;
|
||||
module2.exports.H2CClient = H2CClient;
|
||||
module2.exports.RetryHandler = RetryHandler;
|
||||
@@ -52516,23 +52516,12 @@ var VERSIONS_MANIFEST_URL = "https://raw.githubusercontent.com/astral-sh/version
|
||||
|
||||
// src/utils/fetch.ts
|
||||
var import_undici2 = __toESM(require_undici2(), 1);
|
||||
function getProxyAgent() {
|
||||
const httpProxy = process.env.HTTP_PROXY || process.env.http_proxy;
|
||||
if (httpProxy) {
|
||||
return new import_undici2.ProxyAgent(httpProxy);
|
||||
}
|
||||
const httpsProxy = process.env.HTTPS_PROXY || process.env.https_proxy;
|
||||
if (httpsProxy) {
|
||||
return new import_undici2.ProxyAgent(httpsProxy);
|
||||
}
|
||||
return void 0;
|
||||
}
|
||||
var fetch = async (url, opts) => {
|
||||
const timeoutSignal = AbortSignal.timeout(5e3);
|
||||
const existingSignal = opts.signal;
|
||||
const mergedSignal = existingSignal ? AbortSignal.any([timeoutSignal, existingSignal]) : timeoutSignal;
|
||||
return await (0, import_undici2.fetch)(url, {
|
||||
dispatcher: getProxyAgent(),
|
||||
dispatcher: new import_undici2.EnvHttpProxyAgent(),
|
||||
...opts,
|
||||
signal: mergedSignal
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user