mirror of
https://github.com/tenrok/axios.git
synced 2026-06-20 20:00:40 +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 settle from './../core/settle.js';
|
||||||
import buildFullPath from '../core/buildFullPath.js';
|
import buildFullPath from '../core/buildFullPath.js';
|
||||||
import buildURL from './../helpers/buildURL.js';
|
import buildURL from './../helpers/buildURL.js';
|
||||||
import {getProxyForUrl} from 'proxy-from-env';
|
import proxyFromEnv from 'proxy-from-env';
|
||||||
import http from 'http';
|
import http from 'http';
|
||||||
import https from 'https';
|
import https from 'https';
|
||||||
import util from 'util';
|
import util from 'util';
|
||||||
@@ -83,7 +83,7 @@ function dispatchBeforeRedirect(options, responseDetails) {
|
|||||||
function setProxy(options, configProxy, location) {
|
function setProxy(options, configProxy, location) {
|
||||||
let proxy = configProxy;
|
let proxy = configProxy;
|
||||||
if (!proxy && proxy !== false) {
|
if (!proxy && proxy !== false) {
|
||||||
const proxyUrl = getProxyForUrl(location);
|
const proxyUrl = proxyFromEnv.getProxyForUrl(location);
|
||||||
if (proxyUrl) {
|
if (proxyUrl) {
|
||||||
proxy = new URL(proxyUrl);
|
proxy = new URL(proxyUrl);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user