Skip to content

Commit

Permalink
version
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrurodr committed Mar 7, 2022
1 parent 880ebb3 commit 45d1871
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lib/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,12 +69,12 @@ function wrapWebhook(webhook, payload) {
const fullProxy = process.env['http_proxy'] || process.env['HTTP_PROXY'] || process.env['https_proxy'] || process.env['HTTPS_PROXY'];
const host = fullProxy ? fullProxy.split(':')[0] : '';
const port = fullProxy ? parseInt(fullProxy.split(':')[1]) : '';
let proxy = host && port ? { proxy: { host, port } } : {};
if (fullProxy) {
const agent = new https_proxy_agent_1.HttpsProxyAgent(fullProxy);
let proxy = host && port ? { proxy: { host, port } } : null;
if (proxy) {
const agent = new https_proxy_agent_1.HttpsProxyAgent({ host, port, rejectUnauthorized: false });
proxy = Object.assign(Object.assign({}, proxy), { httpAgent: agent, httpsAgent: agent });
}
const client = axios_1.default.create(proxy);
const client = axios_1.default.create(Object.assign(Object.assign({}, proxy), { maxRedirects: 0, timeout: 0 }));
client.interceptors.request.use((config) => {
utils_1.logInfo(JSON.stringify(config));
return config;
Expand Down

0 comments on commit 45d1871

Please sign in to comment.