Skip to content

Commit

Permalink
another try
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrurodr committed Mar 7, 2022
1 parent c715dc2 commit 880ebb3
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,12 @@ function wrapWebhook(webhook: string, payload: Object): Promise<void> {
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: any = host && port ? { proxy: { host, port }} : {}
if(fullProxy) {
const agent = new HttpsProxyAgent(fullProxy)
let proxy: any = host && port ? { proxy: { host, port }} : null
if(proxy) {
const agent = new HttpsProxyAgent({host, port, rejectUnauthorized: false})
proxy = {...proxy, httpAgent: agent, httpsAgent: agent}
}
const client = axios.create(proxy)
const client = axios.create({...proxy, maxRedirects: 0, timeout: 0, })
client.interceptors.request.use( (config: AxiosRequestConfig) => {
logInfo(JSON.stringify(config))
return config
Expand Down

0 comments on commit 880ebb3

Please sign in to comment.