Changeset 0c6b92a for imaps-frontend/node_modules/axios/dist/node/axios.cjs
Legend:
- Unmodified
- Added
- Removed
-
imaps-frontend/node_modules/axios/dist/node/axios.cjs
rd565449 r0c6b92a 1 // Axios v1.7. 7Copyright (c) 2024 Matt Zabriskie and contributors1 // Axios v1.7.8 Copyright (c) 2024 Matt Zabriskie and contributors 2 2 'use strict'; 3 3 … … 17 17 const FormData__default = /*#__PURE__*/_interopDefaultLegacy(FormData$1); 18 18 const url__default = /*#__PURE__*/_interopDefaultLegacy(url); 19 const proxyFromEnv__default = /*#__PURE__*/_interopDefaultLegacy(proxyFromEnv); 19 20 const http__default = /*#__PURE__*/_interopDefaultLegacy(http); 20 21 const https__default = /*#__PURE__*/_interopDefaultLegacy(https); … … 1172 1173 * @param {string} url The base of the url (e.g., http://www.google.com) 1173 1174 * @param {object} [params] The params to be appended 1174 * @param {? object} options1175 * @param {?(object|Function)} options 1175 1176 * 1176 1177 * @returns {string} The formatted url … … 1183 1184 1184 1185 const _encode = options && options.encode || encode; 1186 1187 if (utils$1.isFunction(options)) { 1188 options = { 1189 serialize: options 1190 }; 1191 } 1185 1192 1186 1193 const serializeFn = options && options.serialize; … … 2072 2079 } 2073 2080 2074 const VERSION = "1.7. 7";2081 const VERSION = "1.7.8"; 2075 2082 2076 2083 function parseProtocol(url) { … … 2284 2291 const BOUNDARY_ALPHABET = utils$1.ALPHABET.ALPHA_DIGIT + '-_'; 2285 2292 2286 const textEncoder = new util.TextEncoder();2293 const textEncoder = typeof TextEncoder === 'function' ? new TextEncoder() : new util__default["default"].TextEncoder(); 2287 2294 2288 2295 const CRLF = '\r\n'; … … 2622 2629 let proxy = configProxy; 2623 2630 if (!proxy && proxy !== false) { 2624 const proxyUrl = proxyFromEnv .getProxyForUrl(location);2631 const proxyUrl = proxyFromEnv__default["default"].getProxyForUrl(location); 2625 2632 if (proxyUrl) { 2626 2633 proxy = new URL(proxyUrl); … … 2853 2860 } 2854 2861 } 2855 } else if (utils$1.isBlob(data) ) {2862 } else if (utils$1.isBlob(data) || utils$1.isFile(data)) { 2856 2863 data.size && headers.setContentType(data.type || 'application/octet-stream'); 2857 2864 headers.setContentLength(data.size || 0); … … 3106 3113 3107 3114 const err = new AxiosError( 3108 ' maxContentLength size of ' + config.maxContentLength + ' exceeded',3115 'stream has been aborted', 3109 3116 AxiosError.ERR_BAD_RESPONSE, 3110 3117 config, … … 3229 3236 }; 3230 3237 3231 const isURLSameOrigin = platform.hasStandardBrowserEnv ? 3232 3233 // Standard browser envs have full support of the APIs needed to test 3234 // whether the request URL is of the same origin as current location. 3235 (function standardBrowserEnv() { 3236 const msie = platform.navigator && /(msie|trident)/i.test(platform.navigator.userAgent); 3237 const urlParsingNode = document.createElement('a'); 3238 let originURL; 3239 3240 /** 3241 * Parse a URL to discover its components 3242 * 3243 * @param {String} url The URL to be parsed 3244 * @returns {Object} 3245 */ 3246 function resolveURL(url) { 3247 let href = url; 3248 3249 if (msie) { 3250 // IE needs attribute set twice to normalize properties 3251 urlParsingNode.setAttribute('href', href); 3252 href = urlParsingNode.href; 3253 } 3254 3255 urlParsingNode.setAttribute('href', href); 3256 3257 // urlParsingNode provides the UrlUtils interface - http://url.spec.whatwg.org/#urlutils 3258 return { 3259 href: urlParsingNode.href, 3260 protocol: urlParsingNode.protocol ? urlParsingNode.protocol.replace(/:$/, '') : '', 3261 host: urlParsingNode.host, 3262 search: urlParsingNode.search ? urlParsingNode.search.replace(/^\?/, '') : '', 3263 hash: urlParsingNode.hash ? urlParsingNode.hash.replace(/^#/, '') : '', 3264 hostname: urlParsingNode.hostname, 3265 port: urlParsingNode.port, 3266 pathname: (urlParsingNode.pathname.charAt(0) === '/') ? 3267 urlParsingNode.pathname : 3268 '/' + urlParsingNode.pathname 3269 }; 3270 } 3271 3272 originURL = resolveURL(window.location.href); 3273 3274 /** 3275 * Determine if a URL shares the same origin as the current location 3276 * 3277 * @param {String} requestURL The URL to test 3278 * @returns {boolean} True if URL shares the same origin, otherwise false 3279 */ 3280 return function isURLSameOrigin(requestURL) { 3281 const parsed = (utils$1.isString(requestURL)) ? resolveURL(requestURL) : requestURL; 3282 return (parsed.protocol === originURL.protocol && 3283 parsed.host === originURL.host); 3284 }; 3285 })() : 3286 3287 // Non standard browser envs (web workers, react-native) lack needed support. 3288 (function nonStandardBrowserEnv() { 3289 return function isURLSameOrigin() { 3290 return true; 3291 }; 3292 })(); 3238 const isURLSameOrigin = platform.hasStandardBrowserEnv ? ((origin, isMSIE) => (url) => { 3239 url = new URL(url, platform.origin); 3240 3241 return ( 3242 origin.protocol === url.protocol && 3243 origin.host === url.host && 3244 (isMSIE || origin.port === url.port) 3245 ); 3246 })( 3247 new URL(platform.origin), 3248 platform.navigator && /(msie|trident)/i.test(platform.navigator.userAgent) 3249 ) : () => true; 3293 3250 3294 3251 const cookies = platform.hasStandardBrowserEnv ? … … 3347 3304 const config = {}; 3348 3305 3349 function getMergedValue(target, source, caseless) {3306 function getMergedValue(target, source, prop, caseless) { 3350 3307 if (utils$1.isPlainObject(target) && utils$1.isPlainObject(source)) { 3351 3308 return utils$1.merge.call({caseless}, target, source); … … 3359 3316 3360 3317 // eslint-disable-next-line consistent-return 3361 function mergeDeepProperties(a, b, caseless) {3318 function mergeDeepProperties(a, b, prop , caseless) { 3362 3319 if (!utils$1.isUndefined(b)) { 3363 return getMergedValue(a, b, caseless);3320 return getMergedValue(a, b, prop , caseless); 3364 3321 } else if (!utils$1.isUndefined(a)) { 3365 return getMergedValue(undefined, a, caseless);3322 return getMergedValue(undefined, a, prop , caseless); 3366 3323 } 3367 3324 } … … 3421 3378 responseEncoding: defaultToConfig2, 3422 3379 validateStatus: mergeDirectKeys, 3423 headers: (a, b ) => mergeDeepProperties(headersToObject(a), headersToObject(b), true)3380 headers: (a, b , prop) => mergeDeepProperties(headersToObject(a), headersToObject(b),prop, true) 3424 3381 }; 3425 3382 … … 4214 4171 }; 4215 4172 4173 validators$1.spelling = function spelling(correctSpelling) { 4174 return (value, opt) => { 4175 // eslint-disable-next-line no-console 4176 console.warn(`${opt} is likely a misspelling of ${correctSpelling}`); 4177 return true; 4178 } 4179 }; 4180 4216 4181 /** 4217 4182 * Assert object's properties type … … 4283 4248 } catch (err) { 4284 4249 if (err instanceof Error) { 4285 let dummy ;4286 4287 Error.captureStackTrace ? Error.captureStackTrace(dummy = {}) : (dummy = new Error());4250 let dummy = {}; 4251 4252 Error.captureStackTrace ? Error.captureStackTrace(dummy) : (dummy = new Error()); 4288 4253 4289 4254 // slice off the Error: ... line … … 4339 4304 } 4340 4305 } 4306 4307 validator.assertOptions(config, { 4308 baseUrl: validators.spelling('baseURL'), 4309 withXsrfToken: validators.spelling('withXSRFToken') 4310 }, true); 4341 4311 4342 4312 // Set config.method
Note:
See TracChangeset
for help on using the changeset viewer.