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:
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user