Legend:
- Unmodified
- Added
- Removed
-
imaps-frontend/node_modules/axios/dist/browser/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 … … 1153 1153 * @param {string} url The base of the url (e.g., http://www.google.com) 1154 1154 * @param {object} [params] The params to be appended 1155 * @param {? object} options1155 * @param {?(object|Function)} options 1156 1156 * 1157 1157 * @returns {string} The formatted url … … 1164 1164 1165 1165 const _encode = options && options.encode || encode; 1166 1167 if (utils$1.isFunction(options)) { 1168 options = { 1169 serialize: options 1170 }; 1171 } 1166 1172 1167 1173 const serializeFn = options && options.serialize; … … 2153 2159 const asyncDecorator = (fn) => (...args) => utils$1.asap(() => fn(...args)); 2154 2160 2155 var isURLSameOrigin = platform.hasStandardBrowserEnv ? 2156 2157 // Standard browser envs have full support of the APIs needed to test 2158 // whether the request URL is of the same origin as current location. 2159 (function standardBrowserEnv() { 2160 const msie = platform.navigator && /(msie|trident)/i.test(platform.navigator.userAgent); 2161 const urlParsingNode = document.createElement('a'); 2162 let originURL; 2163 2164 /** 2165 * Parse a URL to discover its components 2166 * 2167 * @param {String} url The URL to be parsed 2168 * @returns {Object} 2169 */ 2170 function resolveURL(url) { 2171 let href = url; 2172 2173 if (msie) { 2174 // IE needs attribute set twice to normalize properties 2175 urlParsingNode.setAttribute('href', href); 2176 href = urlParsingNode.href; 2177 } 2178 2179 urlParsingNode.setAttribute('href', href); 2180 2181 // urlParsingNode provides the UrlUtils interface - http://url.spec.whatwg.org/#urlutils 2182 return { 2183 href: urlParsingNode.href, 2184 protocol: urlParsingNode.protocol ? urlParsingNode.protocol.replace(/:$/, '') : '', 2185 host: urlParsingNode.host, 2186 search: urlParsingNode.search ? urlParsingNode.search.replace(/^\?/, '') : '', 2187 hash: urlParsingNode.hash ? urlParsingNode.hash.replace(/^#/, '') : '', 2188 hostname: urlParsingNode.hostname, 2189 port: urlParsingNode.port, 2190 pathname: (urlParsingNode.pathname.charAt(0) === '/') ? 2191 urlParsingNode.pathname : 2192 '/' + urlParsingNode.pathname 2193 }; 2194 } 2195 2196 originURL = resolveURL(window.location.href); 2197 2198 /** 2199 * Determine if a URL shares the same origin as the current location 2200 * 2201 * @param {String} requestURL The URL to test 2202 * @returns {boolean} True if URL shares the same origin, otherwise false 2203 */ 2204 return function isURLSameOrigin(requestURL) { 2205 const parsed = (utils$1.isString(requestURL)) ? resolveURL(requestURL) : requestURL; 2206 return (parsed.protocol === originURL.protocol && 2207 parsed.host === originURL.host); 2208 }; 2209 })() : 2210 2211 // Non standard browser envs (web workers, react-native) lack needed support. 2212 (function nonStandardBrowserEnv() { 2213 return function isURLSameOrigin() { 2214 return true; 2215 }; 2216 })(); 2161 var isURLSameOrigin = platform.hasStandardBrowserEnv ? ((origin, isMSIE) => (url) => { 2162 url = new URL(url, platform.origin); 2163 2164 return ( 2165 origin.protocol === url.protocol && 2166 origin.host === url.host && 2167 (isMSIE || origin.port === url.port) 2168 ); 2169 })( 2170 new URL(platform.origin), 2171 platform.navigator && /(msie|trident)/i.test(platform.navigator.userAgent) 2172 ) : () => true; 2217 2173 2218 2174 var cookies = platform.hasStandardBrowserEnv ? … … 2316 2272 const config = {}; 2317 2273 2318 function getMergedValue(target, source, caseless) {2274 function getMergedValue(target, source, prop, caseless) { 2319 2275 if (utils$1.isPlainObject(target) && utils$1.isPlainObject(source)) { 2320 2276 return utils$1.merge.call({caseless}, target, source); … … 2328 2284 2329 2285 // eslint-disable-next-line consistent-return 2330 function mergeDeepProperties(a, b, caseless) {2286 function mergeDeepProperties(a, b, prop , caseless) { 2331 2287 if (!utils$1.isUndefined(b)) { 2332 return getMergedValue(a, b, caseless);2288 return getMergedValue(a, b, prop , caseless); 2333 2289 } else if (!utils$1.isUndefined(a)) { 2334 return getMergedValue(undefined, a, caseless);2290 return getMergedValue(undefined, a, prop , caseless); 2335 2291 } 2336 2292 } … … 2390 2346 responseEncoding: defaultToConfig2, 2391 2347 validateStatus: mergeDirectKeys, 2392 headers: (a, b ) => mergeDeepProperties(headersToObject(a), headersToObject(b), true)2348 headers: (a, b , prop) => mergeDeepProperties(headersToObject(a), headersToObject(b),prop, true) 2393 2349 }; 2394 2350 … … 3134 3090 } 3135 3091 3136 const VERSION = "1.7. 7";3092 const VERSION = "1.7.8"; 3137 3093 3138 3094 const validators$1 = {}; … … 3183 3139 return validator ? validator(value, opt, opts) : true; 3184 3140 }; 3141 }; 3142 3143 validators$1.spelling = function spelling(correctSpelling) { 3144 return (value, opt) => { 3145 // eslint-disable-next-line no-console 3146 console.warn(`${opt} is likely a misspelling of ${correctSpelling}`); 3147 return true; 3148 } 3185 3149 }; 3186 3150 … … 3254 3218 } catch (err) { 3255 3219 if (err instanceof Error) { 3256 let dummy ;3257 3258 Error.captureStackTrace ? Error.captureStackTrace(dummy = {}) : (dummy = new Error());3220 let dummy = {}; 3221 3222 Error.captureStackTrace ? Error.captureStackTrace(dummy) : (dummy = new Error()); 3259 3223 3260 3224 // slice off the Error: ... line … … 3310 3274 } 3311 3275 } 3276 3277 validator.assertOptions(config, { 3278 baseUrl: validators.spelling('baseURL'), 3279 withXsrfToken: validators.spelling('withXSRFToken') 3280 }, true); 3312 3281 3313 3282 // Set config.method
Note:
See TracChangeset
for help on using the changeset viewer.