@@ -1055,6 +1055,31 @@ var enhanceError = __webpack_require__(8575);
10551055
10561056var isHttps = / h t t p s : ? / ;
10571057
1058+ /**
1059+ *
1060+ * @param {http.ClientRequestArgs } options
1061+ * @param {AxiosProxyConfig } proxy
1062+ * @param {string } location
1063+ */
1064+ function setProxy ( options , proxy , location ) {
1065+ options . hostname = proxy . host ;
1066+ options . host = proxy . host ;
1067+ options . port = proxy . port ;
1068+ options . path = location ;
1069+
1070+ // Basic proxy authorization
1071+ if ( proxy . auth ) {
1072+ var base64 = Buffer . from ( proxy . auth . username + ':' + proxy . auth . password , 'utf8' ) . toString ( 'base64' ) ;
1073+ options . headers [ 'Proxy-Authorization' ] = 'Basic ' + base64 ;
1074+ }
1075+
1076+ // If a proxy is used, any redirects must also pass through the proxy
1077+ options . beforeRedirect = function beforeRedirect ( redirection ) {
1078+ redirection . headers . host = redirection . host ;
1079+ setProxy ( redirection , proxy , redirection . href ) ;
1080+ } ;
1081+ }
1082+
10581083/*eslint consistent-return:0*/
10591084module . exports = function httpAdapter ( config ) {
10601085 return new Promise ( function dispatchHttpRequest ( resolvePromise , rejectPromise ) {
@@ -1165,11 +1190,11 @@ module.exports = function httpAdapter(config) {
11651190 } ) ;
11661191 }
11671192
1168-
11691193 if ( shouldProxy ) {
11701194 proxy = {
11711195 host : parsedProxyUrl . hostname ,
1172- port : parsedProxyUrl . port
1196+ port : parsedProxyUrl . port ,
1197+ protocol : parsedProxyUrl . protocol
11731198 } ;
11741199
11751200 if ( parsedProxyUrl . auth ) {
@@ -1184,17 +1209,8 @@ module.exports = function httpAdapter(config) {
11841209 }
11851210
11861211 if ( proxy ) {
1187- options . hostname = proxy . host ;
1188- options . host = proxy . host ;
11891212 options . headers . host = parsed . hostname + ( parsed . port ? ':' + parsed . port : '' ) ;
1190- options . port = proxy . port ;
1191- options . path = protocol + '//' + parsed . hostname + ( parsed . port ? ':' + parsed . port : '' ) + options . path ;
1192-
1193- // Basic proxy authorization
1194- if ( proxy . auth ) {
1195- var base64 = Buffer . from ( proxy . auth . username + ':' + proxy . auth . password , 'utf8' ) . toString ( 'base64' ) ;
1196- options . headers [ 'Proxy-Authorization' ] = 'Basic ' + base64 ;
1197- }
1213+ setProxy ( options , proxy , protocol + '//' + parsed . hostname + ( parsed . port ? ':' + parsed . port : '' ) + options . path ) ;
11981214 }
11991215
12001216 var transport ;
@@ -1568,6 +1584,9 @@ axios.all = function all(promises) {
15681584} ;
15691585axios . spread = __webpack_require__ ( 5432 ) ;
15701586
1587+ // Expose isAxiosError
1588+ axios . isAxiosError = __webpack_require__ ( 6114 ) ;
1589+
15711590module . exports = axios ;
15721591
15731592// Allow use of default import syntax in TypeScript
@@ -2497,6 +2516,25 @@ module.exports = function isAbsoluteURL(url) {
24972516} ;
24982517
24992518
2519+ /***/ } ) ,
2520+
2521+ /***/ 6114 :
2522+ /***/ ( ( module ) => {
2523+
2524+ "use strict" ;
2525+
2526+
2527+ /**
2528+ * Determines whether the payload is an error thrown by Axios
2529+ *
2530+ * @param {* } payload The value to test
2531+ * @returns {boolean } True if the payload is an error thrown by Axios, otherwise false
2532+ */
2533+ module . exports = function isAxiosError ( payload ) {
2534+ return ( typeof payload === 'object' ) && ( payload . isAxiosError === true ) ;
2535+ } ;
2536+
2537+
25002538/***/ } ) ,
25012539
25022540/***/ 7446 :
@@ -7702,7 +7740,7 @@ WayBack.statusGuidRegex = /watchJob\("(?<guid>[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a
77027740/***/ ( ( module ) => {
77037741
77047742"use strict" ;
7705- module . exports = JSON . parse ( "{\"name\":\"axios\",\"version\":\"0.21.0\",\"description\":\"Promise based HTTP client for the browser and node.js\",\"main\":\"index.js\",\"scripts\":{\"test\":\"grunt test && bundlesize\",\"start\":\"node ./sandbox/server.js\",\"build\":\"NODE_ENV=production grunt build\",\"preversion\":\"npm test\",\"version\":\"npm run build && grunt version && git add -A dist && git add CHANGELOG.md bower.json package.json\",\"postversion\":\"git push && git push --tags\",\"examples\":\"node ./examples/server.js\",\"coveralls\":\"cat coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js\",\"fix\":\"eslint --fix lib/**/*.js\"},\"repository\":{\"type\":\"git\",\"url\":\"https://github.com/axios/axios.git\"},\"keywords\":[\"xhr\",\"http\",\"ajax\",\"promise\",\"node\"],\"author\":\"Matt Zabriskie\",\"license\":\"MIT\",\"bugs\":{\"url\":\"https://github.com/axios/axios/issues\"},\"homepage\":\"https://github.com/axios/axios\",\"devDependencies\":{\"bundlesize\":\"^0.17.0\",\"coveralls\":\"^3.0.0\",\"es6-promise\":\"^4.2.4\",\"grunt\":\"^1.0.2\",\"grunt-banner\":\"^0.6.0\",\"grunt-cli\":\"^1.2.0\",\"grunt-contrib-clean\":\"^1.1.0\",\"grunt-contrib-watch\":\"^1.0.0\",\"grunt-eslint\":\"^20.1.0\",\"grunt-karma\":\"^2.0.0\",\"grunt-mocha-test\":\"^0.13.3\",\"grunt-ts\":\"^6.0.0-beta.19\",\"grunt-webpack\":\"^1.0.18\",\"istanbul-instrumenter-loader\":\"^1.0.0\",\"jasmine-core\":\"^2.4.1\",\"karma\":\"^1.3.0\",\"karma-chrome-launcher\":\"^2.2.0\",\"karma-coverage\":\"^1.1.1\",\"karma-firefox-launcher\":\"^1.1.0\",\"karma-jasmine\":\"^1.1.1\",\"karma-jasmine-ajax\":\"^0.1.13\",\"karma-opera-launcher\":\"^1.0.0\",\"karma-safari-launcher\":\"^1.0.0\",\"karma-sauce-launcher\":\"^1.2.0\",\"karma-sinon\":\"^1.0.5\",\"karma-sourcemap-loader\":\"^0.3.7\",\"karma-webpack\":\"^1.7.0\",\"load-grunt-tasks\":\"^3.5.2\",\"minimist\":\"^1.2.0\",\"mocha\":\"^5.2.0\",\"sinon\":\"^4.5.0\",\"typescript\":\"^2.8.1\",\"url-search-params\":\"^0.10.0\",\"webpack\":\"^1.13.1\",\"webpack-dev-server\":\"^1.14.1\"},\"browser\":{\"./lib/adapters/http.js\":\"./lib/adapters/xhr.js\"},\"jsdelivr\":\"dist/axios.min.js\",\"unpkg\":\"dist/axios.min.js\",\"typings\":\"./index.d.ts\",\"dependencies\":{\"follow-redirects\":\"^1.10.0\"},\"bundlesize\":[{\"path\":\"./dist/axios.min.js\",\"threshold\":\"5kB\"}]}" ) ;
7743+ module . exports = JSON . parse ( "{\"name\":\"axios\",\"version\":\"0.21.1\",\"description\":\"Promise based HTTP client for the browser and node.js\",\"main\":\"index.js\",\"scripts\":{\"test\":\"grunt test && bundlesize\",\"start\":\"node ./sandbox/server.js\",\"build\":\"NODE_ENV=production grunt build\",\"preversion\":\"npm test\",\"version\":\"npm run build && grunt version && git add -A dist && git add CHANGELOG.md bower.json package.json\",\"postversion\":\"git push && git push --tags\",\"examples\":\"node ./examples/server.js\",\"coveralls\":\"cat coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js\",\"fix\":\"eslint --fix lib/**/*.js\"},\"repository\":{\"type\":\"git\",\"url\":\"https://github.com/axios/axios.git\"},\"keywords\":[\"xhr\",\"http\",\"ajax\",\"promise\",\"node\"],\"author\":\"Matt Zabriskie\",\"license\":\"MIT\",\"bugs\":{\"url\":\"https://github.com/axios/axios/issues\"},\"homepage\":\"https://github.com/axios/axios\",\"devDependencies\":{\"bundlesize\":\"^0.17.0\",\"coveralls\":\"^3.0.0\",\"es6-promise\":\"^4.2.4\",\"grunt\":\"^1.0.2\",\"grunt-banner\":\"^0.6.0\",\"grunt-cli\":\"^1.2.0\",\"grunt-contrib-clean\":\"^1.1.0\",\"grunt-contrib-watch\":\"^1.0.0\",\"grunt-eslint\":\"^20.1.0\",\"grunt-karma\":\"^2.0.0\",\"grunt-mocha-test\":\"^0.13.3\",\"grunt-ts\":\"^6.0.0-beta.19\",\"grunt-webpack\":\"^1.0.18\",\"istanbul-instrumenter-loader\":\"^1.0.0\",\"jasmine-core\":\"^2.4.1\",\"karma\":\"^1.3.0\",\"karma-chrome-launcher\":\"^2.2.0\",\"karma-coverage\":\"^1.1.1\",\"karma-firefox-launcher\":\"^1.1.0\",\"karma-jasmine\":\"^1.1.1\",\"karma-jasmine-ajax\":\"^0.1.13\",\"karma-opera-launcher\":\"^1.0.0\",\"karma-safari-launcher\":\"^1.0.0\",\"karma-sauce-launcher\":\"^1.2.0\",\"karma-sinon\":\"^1.0.5\",\"karma-sourcemap-loader\":\"^0.3.7\",\"karma-webpack\":\"^1.7.0\",\"load-grunt-tasks\":\"^3.5.2\",\"minimist\":\"^1.2.0\",\"mocha\":\"^5.2.0\",\"sinon\":\"^4.5.0\",\"typescript\":\"^2.8.1\",\"url-search-params\":\"^0.10.0\",\"webpack\":\"^1.13.1\",\"webpack-dev-server\":\"^1.14.1\"},\"browser\":{\"./lib/adapters/http.js\":\"./lib/adapters/xhr.js\"},\"jsdelivr\":\"dist/axios.min.js\",\"unpkg\":\"dist/axios.min.js\",\"typings\":\"./index.d.ts\",\"dependencies\":{\"follow-redirects\":\"^1.10.0\"},\"bundlesize\":[{\"path\":\"./dist/axios.min.js\",\"threshold\":\"5kB\"}]}" ) ;
77067744
77077745/***/ } ) ,
77087746
0 commit comments