fix: use base url for proxy check
This commit is contained in:
parent
3af7a9ca6a
commit
a3b217da0b
2
dist/index.js
vendored
2
dist/index.js
vendored
@ -1241,7 +1241,7 @@ exports.Octokit = core_1.Octokit.plugin(plugin_paginate_rest_1.paginateRest, plu
|
|||||||
// Octokit plugin to support the standard environment variables http_proxy, https_proxy and no_proxy
|
// Octokit plugin to support the standard environment variables http_proxy, https_proxy and no_proxy
|
||||||
function autoProxyAgent(octokit) {
|
function autoProxyAgent(octokit) {
|
||||||
octokit.hook.before('request', options => {
|
octokit.hook.before('request', options => {
|
||||||
const proxy = (0, proxy_from_env_1.getProxyForUrl)(options.url);
|
const proxy = (0, proxy_from_env_1.getProxyForUrl)(options.baseUrl);
|
||||||
if (proxy) {
|
if (proxy) {
|
||||||
options.request.agent = new https_proxy_agent_1.HttpsProxyAgent(proxy);
|
options.request.agent = new https_proxy_agent_1.HttpsProxyAgent(proxy);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -15,7 +15,7 @@ export const Octokit = Core.plugin(
|
|||||||
// Octokit plugin to support the standard environment variables http_proxy, https_proxy and no_proxy
|
// Octokit plugin to support the standard environment variables http_proxy, https_proxy and no_proxy
|
||||||
function autoProxyAgent(octokit: Core) {
|
function autoProxyAgent(octokit: Core) {
|
||||||
octokit.hook.before('request', options => {
|
octokit.hook.before('request', options => {
|
||||||
const proxy = getProxyForUrl(options.url)
|
const proxy = getProxyForUrl(options.baseUrl)
|
||||||
if (proxy) {
|
if (proxy) {
|
||||||
options.request.agent = new HttpsProxyAgent(proxy)
|
options.request.agent = new HttpsProxyAgent(proxy)
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user