This commit is contained in:
2025-05-12 14:25:25 +02:00
parent ab2db755ef
commit 9e378ca2b7
2719 changed files with 46505 additions and 60181 deletions

View File

@@ -213,7 +213,7 @@ export default isFetchSupported && (async (config) => {
} catch (err) {
unsubscribe && unsubscribe();
if (err && err.name === 'TypeError' && /fetch/i.test(err.message)) {
if (err && err.name === 'TypeError' && /Load failed|fetch/i.test(err.message)) {
throw Object.assign(
new AxiosError('Network Error', AxiosError.ERR_NETWORK, config, request),
{

View File

@@ -20,7 +20,7 @@ const validators = validator.validators;
*/
class Axios {
constructor(instanceConfig) {
this.defaults = instanceConfig;
this.defaults = instanceConfig || {};
this.interceptors = {
request: new InterceptorManager(),
response: new InterceptorManager()

View File

@@ -100,10 +100,18 @@ class AxiosHeaders {
setHeaders(header, valueOrRewrite)
} else if(utils.isString(header) && (header = header.trim()) && !isValidHeaderName(header)) {
setHeaders(parseHeaders(header), valueOrRewrite);
} else if (utils.isHeaders(header)) {
for (const [key, value] of header.entries()) {
setHeader(value, key, rewrite);
} else if (utils.isObject(header) && utils.isIterable(header)) {
let obj = {}, dest, key;
for (const entry of header) {
if (!utils.isArray(entry)) {
throw TypeError('Object iterator must return a key-value pair');
}
obj[key = entry[0]] = (dest = obj[key]) ?
(utils.isArray(dest) ? [...dest, entry[1]] : [dest, entry[1]]) : entry[1];
}
setHeaders(obj, valueOrRewrite)
} else {
header != null && setHeader(valueOrRewrite, header, rewrite);
}
@@ -245,6 +253,10 @@ class AxiosHeaders {
return Object.entries(this.toJSON()).map(([header, value]) => header + ': ' + value).join('\n');
}
getSetCookie() {
return this.get("set-cookie") || [];
}
get [Symbol.toStringTag]() {
return 'AxiosHeaders';
}

2
node_modules/axios/lib/env/data.js generated vendored
View File

@@ -1 +1 @@
export const VERSION = "1.8.4";
export const VERSION = "1.9.0";

View File

@@ -76,7 +76,7 @@ const formDataToStream = (form, headersHandler, options) => {
}
const boundaryBytes = textEncoder.encode('--' + boundary + CRLF);
const footerBytes = textEncoder.encode('--' + boundary + '--' + CRLF + CRLF);
const footerBytes = textEncoder.encode('--' + boundary + '--' + CRLF);
let contentLength = footerBytes.byteLength;
const parts = Array.from(form.entries()).map(([name, value]) => {

18
node_modules/axios/lib/utils.js generated vendored
View File

@@ -6,6 +6,7 @@ import bind from './helpers/bind.js';
const {toString} = Object.prototype;
const {getPrototypeOf} = Object;
const {iterator, toStringTag} = Symbol;
const kindOf = (cache => thing => {
const str = toString.call(thing);
@@ -132,7 +133,7 @@ const isPlainObject = (val) => {
}
const prototype = getPrototypeOf(val);
return (prototype === null || prototype === Object.prototype || Object.getPrototypeOf(prototype) === null) && !(Symbol.toStringTag in val) && !(Symbol.iterator in val);
return (prototype === null || prototype === Object.prototype || Object.getPrototypeOf(prototype) === null) && !(toStringTag in val) && !(iterator in val);
}
/**
@@ -483,13 +484,13 @@ const isTypedArray = (TypedArray => {
* @returns {void}
*/
const forEachEntry = (obj, fn) => {
const generator = obj && obj[Symbol.iterator];
const generator = obj && obj[iterator];
const iterator = generator.call(obj);
const _iterator = generator.call(obj);
let result;
while ((result = iterator.next()) && !result.done) {
while ((result = _iterator.next()) && !result.done) {
const pair = result.value;
fn.call(obj, pair[0], pair[1]);
}
@@ -610,7 +611,7 @@ const toFiniteNumber = (value, defaultValue) => {
* @returns {boolean}
*/
function isSpecCompliantForm(thing) {
return !!(thing && isFunction(thing.append) && thing[Symbol.toStringTag] === 'FormData' && thing[Symbol.iterator]);
return !!(thing && isFunction(thing.append) && thing[toStringTag] === 'FormData' && thing[iterator]);
}
const toJSONObject = (obj) => {
@@ -679,6 +680,10 @@ const asap = typeof queueMicrotask !== 'undefined' ?
// *********************
const isIterable = (thing) => thing != null && isFunction(thing[iterator]);
export default {
isArray,
isArrayBuffer,
@@ -734,5 +739,6 @@ export default {
isAsyncFn,
isThenable,
setImmediate: _setImmediate,
asap
asap,
isIterable
};