2
0
mirror of https://github.com/tenrok/axios.git synced 2026-05-15 11:59:42 +03:00

fix(http): fixed proxy-from-env module import (#5222)

Co-authored-by: Pavan Welihinda <pavan@babyjourney.se>
Co-authored-by: Dmitriy Mozgovoy <robotshara@gmail.com>
This commit is contained in:
Pavan Welihinda
2024-11-08 00:42:02 +05:30
committed by GitHub
parent fc6fa697fb
commit 12b32957f1
+2 -2
View File
@@ -4,7 +4,7 @@ import utils from './../utils.js';
import settle from './../core/settle.js';
import buildFullPath from '../core/buildFullPath.js';
import buildURL from './../helpers/buildURL.js';
import {getProxyForUrl} from 'proxy-from-env';
import proxyFromEnv from 'proxy-from-env';
import http from 'http';
import https from 'https';
import util from 'util';
@@ -83,7 +83,7 @@ function dispatchBeforeRedirect(options, responseDetails) {
function setProxy(options, configProxy, location) {
let proxy = configProxy;
if (!proxy && proxy !== false) {
const proxyUrl = getProxyForUrl(location);
const proxyUrl = proxyFromEnv.getProxyForUrl(location);
if (proxyUrl) {
proxy = new URL(proxyUrl);
}