MCPcopy Index your code
hub / github.com/di-sukharev/opencommit / proxyPolicy

Function proxyPolicy

out/cli.cjs:76321–76339  ·  view source on GitHub ↗
(proxySettings, options)

Source from the content-addressed store, hash-verified

76319 request3.agent = cachedAgents.httpProxyAgent;
76320 } else {
76321 if (!cachedAgents.httpsProxyAgent) {
76322 cachedAgents.httpsProxyAgent = new import_https_proxy_agent2.HttpsProxyAgent(proxyUrl, { headers });
76323 }
76324 request3.agent = cachedAgents.httpsProxyAgent;
76325 }
76326}
76327function proxyPolicy(proxySettings, options) {
76328 if (!noProxyListLoaded) {
76329 globalNoProxyList.push(...loadNoProxy());
76330 }
76331 const defaultProxy = proxySettings ? getUrlFromProxySettings(proxySettings) : getDefaultProxySettingsInternal();
76332 const cachedAgents = {};
76333 return {
76334 name: proxyPolicyName,
76335 async sendRequest(request3, next) {
76336 var _a5;
76337 if (!request3.proxySettings && defaultProxy && !isBypassed(request3.url, (_a5 = options === null || options === void 0 ? void 0 : options.customNoProxyList) !== null && _a5 !== void 0 ? _a5 : globalNoProxyList, (options === null || options === void 0 ? void 0 : options.customNoProxyList) ? void 0 : globalBypassedMap)) {
76338 setProxyAgentOnRequest(request3, cachedAgents, defaultProxy);
76339 } else if (request3.proxySettings) {
76340 setProxyAgentOnRequest(request3, cachedAgents, getUrlFromProxySettings(request3.proxySettings));
76341 }
76342 return next(request3);

Callers 1

Calls 4

loadNoProxyFunction · 0.85
getUrlFromProxySettingsFunction · 0.85
pushMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…