axios 1.16.0 → 1.17.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/axios.js CHANGED
@@ -1,4 +1,4 @@
1
- /*! Axios v1.16.0 Copyright (c) 2026 Matt Zabriskie and contributors */
1
+ /*! Axios v1.17.0 Copyright (c) 2026 Matt Zabriskie and contributors */
2
2
  (function (global, factory) {
3
3
  typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
4
4
  typeof define === 'function' && define.amd ? define(factory) :
@@ -964,7 +964,10 @@
964
964
  if (key === '__proto__' || key === 'constructor' || key === 'prototype') {
965
965
  return;
966
966
  }
967
- var targetKey = caseless && findKey(result, key) || key;
967
+
968
+ // findKey lowercases the key, so caseless lookup only applies to strings —
969
+ // symbol keys are identity-matched.
970
+ var targetKey = caseless && typeof key === 'string' && findKey(result, key) || key;
968
971
  // Read via own-prop only — a bare `result[targetKey]` walks the prototype
969
972
  // chain, so a polluted Object.prototype value could surface here and get
970
973
  // copied into the merged result.
@@ -979,11 +982,22 @@
979
982
  result[targetKey] = val;
980
983
  }
981
984
  };
982
- for (var _len = arguments.length, objs = new Array(_len), _key2 = 0; _key2 < _len; _key2++) {
983
- objs[_key2] = arguments[_key2];
984
- }
985
- for (var i = 0, l = objs.length; i < l; i++) {
986
- objs[i] && forEach(objs[i], assignValue);
985
+ for (var i = 0, l = arguments.length; i < l; i++) {
986
+ var source = i < 0 || arguments.length <= i ? undefined : arguments[i];
987
+ if (!source || isBuffer(source)) {
988
+ continue;
989
+ }
990
+ forEach(source, assignValue);
991
+ if (_typeof(source) !== 'object' || isArray(source)) {
992
+ continue;
993
+ }
994
+ var symbols = Object.getOwnPropertySymbols(source);
995
+ for (var j = 0; j < symbols.length; j++) {
996
+ var symbol = symbols[j];
997
+ if (propertyIsEnumerable.call(source, symbol)) {
998
+ assignValue(source[symbol], symbol);
999
+ }
1000
+ }
987
1001
  }
988
1002
  return result;
989
1003
  }
@@ -1203,6 +1217,7 @@
1203
1217
  return hasOwnProperty.call(obj, prop);
1204
1218
  };
1205
1219
  }(Object.prototype);
1220
+ var propertyIsEnumerable = Object.prototype.propertyIsEnumerable;
1206
1221
 
1207
1222
  /**
1208
1223
  * Determine if a value is a RegExp object
@@ -1291,10 +1306,10 @@
1291
1306
  * @returns {Object} The JSON-compatible object.
1292
1307
  */
1293
1308
  var toJSONObject = function toJSONObject(obj) {
1294
- var stack = new Array(10);
1295
- var _visit = function visit(source, i) {
1309
+ var visited = new WeakSet();
1310
+ var _visit = function visit(source) {
1296
1311
  if (isObject(source)) {
1297
- if (stack.indexOf(source) >= 0) {
1312
+ if (visited.has(source)) {
1298
1313
  return;
1299
1314
  }
1300
1315
 
@@ -1303,19 +1318,20 @@
1303
1318
  return source;
1304
1319
  }
1305
1320
  if (!('toJSON' in source)) {
1306
- stack[i] = source;
1321
+ // add-on descent / delete-on-ascent: preserves path semantics, so DAG nodes serialise at every occurrence (see #7230).
1322
+ visited.add(source);
1307
1323
  var target = isArray(source) ? [] : {};
1308
1324
  forEach(source, function (value, key) {
1309
- var reducedValue = _visit(value, i + 1);
1325
+ var reducedValue = _visit(value);
1310
1326
  !isUndefined(reducedValue) && (target[key] = reducedValue);
1311
1327
  });
1312
- stack[i] = undefined;
1328
+ visited["delete"](source);
1313
1329
  return target;
1314
1330
  }
1315
1331
  }
1316
1332
  return source;
1317
1333
  };
1318
- return _visit(obj, 0);
1334
+ return _visit(obj);
1319
1335
  };
1320
1336
 
1321
1337
  /**
@@ -1487,8 +1503,6 @@
1487
1503
  return parsed;
1488
1504
  });
1489
1505
 
1490
- var $internals = Symbol('internals');
1491
- var INVALID_HEADER_VALUE_CHARS_RE = /[^\x09\x20-\x7E\x80-\xFF]/g;
1492
1506
  function trimSPorHTAB(str) {
1493
1507
  var start = 0;
1494
1508
  var end = str.length;
@@ -1508,12 +1522,38 @@
1508
1522
  }
1509
1523
  return start === 0 && end === str.length ? str : str.slice(start, end);
1510
1524
  }
1525
+
1526
+ // The control-code ranges are intentional: header sanitization strips C0/DEL bytes.
1527
+ // eslint-disable-next-line no-control-regex
1528
+ var INVALID_UNICODE_HEADER_VALUE_CHARS = new RegExp("[\\u0000-\\u0008\\u000a-\\u001f\\u007f]+", 'g');
1529
+ // eslint-disable-next-line no-control-regex
1530
+ var INVALID_BYTE_STRING_HEADER_VALUE_CHARS = new RegExp("[^\\u0009\\u0020-\\u007e\\u0080-\\u00ff]+", 'g');
1531
+ function sanitizeValue(value, invalidChars) {
1532
+ if (utils$1.isArray(value)) {
1533
+ return value.map(function (item) {
1534
+ return sanitizeValue(item, invalidChars);
1535
+ });
1536
+ }
1537
+ return trimSPorHTAB(String(value).replace(invalidChars, ''));
1538
+ }
1539
+ var sanitizeHeaderValue = function sanitizeHeaderValue(value) {
1540
+ return sanitizeValue(value, INVALID_UNICODE_HEADER_VALUE_CHARS);
1541
+ };
1542
+ var sanitizeByteStringHeaderValue = function sanitizeByteStringHeaderValue(value) {
1543
+ return sanitizeValue(value, INVALID_BYTE_STRING_HEADER_VALUE_CHARS);
1544
+ };
1545
+ function toByteStringHeaderObject(headers) {
1546
+ var byteStringHeaders = Object.create(null);
1547
+ utils$1.forEach(headers.toJSON(), function (value, header) {
1548
+ byteStringHeaders[header] = sanitizeByteStringHeaderValue(value);
1549
+ });
1550
+ return byteStringHeaders;
1551
+ }
1552
+
1553
+ var $internals = Symbol('internals');
1511
1554
  function normalizeHeader(header) {
1512
1555
  return header && String(header).trim().toLowerCase();
1513
1556
  }
1514
- function sanitizeHeaderValue(str) {
1515
- return trimSPorHTAB(str.replace(INVALID_HEADER_VALUE_CHARS_RE, ''));
1516
- }
1517
1557
  function normalizeValue(value) {
1518
1558
  if (value === false || value == null) {
1519
1559
  return value;
@@ -1578,7 +1618,7 @@
1578
1618
  function setHeader(_value, _header, _rewrite) {
1579
1619
  var lHeader = normalizeHeader(_header);
1580
1620
  if (!lHeader) {
1581
- throw new Error('header name must be a non-empty string');
1621
+ return;
1582
1622
  }
1583
1623
  var key = utils$1.findKey(self, lHeader);
1584
1624
  if (!key || self[key] === undefined || _rewrite === true || _rewrite === undefined && self[key] !== false) {
@@ -1604,7 +1644,7 @@
1604
1644
  for (_iterator.s(); !(_step = _iterator.n()).done;) {
1605
1645
  var entry = _step.value;
1606
1646
  if (!utils$1.isArray(entry)) {
1607
- throw TypeError('Object iterator must return a key-value pair');
1647
+ throw new TypeError('Object iterator must return a key-value pair');
1608
1648
  }
1609
1649
  obj[key = entry[0]] = (dest = obj[key]) ? utils$1.isArray(dest) ? [].concat(_toConsumableArray(dest), [entry[1]]) : [dest, entry[1]] : entry[1];
1610
1650
  }
@@ -2146,7 +2186,7 @@
2146
2186
  throw new AxiosError('Object is too deeply nested (' + depth + ' levels). Max depth: ' + maxDepth, AxiosError.ERR_FORM_DATA_DEPTH_EXCEEDED);
2147
2187
  }
2148
2188
  if (stack.indexOf(value) !== -1) {
2149
- throw Error('Circular reference detected in ' + path.join('.'));
2189
+ throw new Error('Circular reference detected in ' + path.join('.'));
2150
2190
  }
2151
2191
  stack.push(value);
2152
2192
  utils$1.forEach(value, function each(el, key) {
@@ -2338,7 +2378,8 @@
2338
2378
  silentJSONParsing: true,
2339
2379
  forcedJSONParsing: true,
2340
2380
  clarifyTimeoutError: false,
2341
- legacyInterceptorReqResOrdering: true
2381
+ legacyInterceptorReqResOrdering: true,
2382
+ advertiseZstdAcceptEncoding: false
2342
2383
  };
2343
2384
 
2344
2385
  var URLSearchParams$1 = typeof URLSearchParams !== 'undefined' ? URLSearchParams : AxiosURLSearchParams;
@@ -2477,7 +2518,7 @@
2477
2518
  }
2478
2519
  return !isNumericKey;
2479
2520
  }
2480
- if (!target[name] || !utils$1.isObject(target[name])) {
2521
+ if (!utils$1.hasOwnProp(target, name) || !utils$1.isObject(target[name])) {
2481
2522
  target[name] = [];
2482
2523
  }
2483
2524
  var result = buildPath(path, value, target[name], index);
@@ -2777,6 +2818,9 @@
2777
2818
  var bytesNotified = 0;
2778
2819
  var _speedometer = speedometer(50, 250);
2779
2820
  return throttle(function (e) {
2821
+ if (!e || typeof e.loaded !== 'number') {
2822
+ return;
2823
+ }
2780
2824
  var rawLoaded = e.loaded;
2781
2825
  var total = e.lengthComputable ? e.total : undefined;
2782
2826
  var loaded = total != null ? Math.min(rawLoaded, total) : rawLoaded;
@@ -3070,12 +3114,12 @@
3070
3114
  *
3071
3115
  * @returns {string} UTF-8 bytes as a Latin-1 string
3072
3116
  */
3073
- var encodeUTF8 = function encodeUTF8(str) {
3117
+ var encodeUTF8$1 = function encodeUTF8(str) {
3074
3118
  return encodeURIComponent(str).replace(/%([0-9A-F]{2})/gi, function (_, hex) {
3075
3119
  return String.fromCharCode(parseInt(hex, 16));
3076
3120
  });
3077
3121
  };
3078
- var resolveConfig = (function (config) {
3122
+ function resolveConfig(config) {
3079
3123
  var newConfig = mergeConfig({}, config);
3080
3124
 
3081
3125
  // Read only own properties to prevent prototype pollution gadgets
@@ -3093,15 +3137,15 @@
3093
3137
  var allowAbsoluteUrls = own('allowAbsoluteUrls');
3094
3138
  var url = own('url');
3095
3139
  newConfig.headers = headers = AxiosHeaders.from(headers);
3096
- newConfig.url = buildURL(buildFullPath(baseURL, url, allowAbsoluteUrls), config.params, config.paramsSerializer);
3140
+ newConfig.url = buildURL(buildFullPath(baseURL, url, allowAbsoluteUrls), own('params'), own('paramsSerializer'));
3097
3141
 
3098
3142
  // HTTP basic authentication
3099
3143
  if (auth) {
3100
- headers.set('Authorization', 'Basic ' + btoa((auth.username || '') + ':' + (auth.password ? encodeUTF8(auth.password) : '')));
3144
+ headers.set('Authorization', 'Basic ' + btoa((auth.username || '') + ':' + (auth.password ? encodeUTF8$1(auth.password) : '')));
3101
3145
  }
3102
3146
  if (utils$1.isFormData(data)) {
3103
- if (platform.hasStandardBrowserEnv || platform.hasStandardBrowserWebWorkerEnv) {
3104
- headers.setContentType(undefined); // browser handles it
3147
+ if (platform.hasStandardBrowserEnv || platform.hasStandardBrowserWebWorkerEnv || utils$1.isReactNative(data)) {
3148
+ headers.setContentType(undefined); // browser/web worker/RN handles it
3105
3149
  } else if (utils$1.isFunction(data.getHeaders)) {
3106
3150
  // Node.js FormData (like form-data package)
3107
3151
  setFormDataHeaders(headers, data.getHeaders(), own('formDataHeaderPolicy'));
@@ -3129,7 +3173,7 @@
3129
3173
  }
3130
3174
  }
3131
3175
  return newConfig;
3132
- });
3176
+ }
3133
3177
 
3134
3178
  var isXHRAdapterSupported = typeof XMLHttpRequest !== 'undefined';
3135
3179
  var xhrAdapter = isXHRAdapterSupported && function (config) {
@@ -3249,7 +3293,7 @@
3249
3293
 
3250
3294
  // Add headers to the request
3251
3295
  if ('setRequestHeader' in request) {
3252
- utils$1.forEach(requestHeaders.toJSON(), function setRequestHeader(val, key) {
3296
+ utils$1.forEach(toByteStringHeaderObject(requestHeaders), function setRequestHeader(val, key) {
3253
3297
  request.setRequestHeader(key, val);
3254
3298
  });
3255
3299
  }
@@ -3311,42 +3355,43 @@
3311
3355
  };
3312
3356
 
3313
3357
  var composeSignals = function composeSignals(signals, timeout) {
3314
- var _signals = signals = signals ? signals.filter(Boolean) : [],
3315
- length = _signals.length;
3316
- if (timeout || length) {
3317
- var controller = new AbortController();
3318
- var aborted;
3319
- var onabort = function onabort(reason) {
3320
- if (!aborted) {
3321
- aborted = true;
3322
- unsubscribe();
3323
- var err = reason instanceof Error ? reason : this.reason;
3324
- controller.abort(err instanceof AxiosError ? err : new CanceledError(err instanceof Error ? err.message : err));
3325
- }
3326
- };
3327
- var timer = timeout && setTimeout(function () {
3328
- timer = null;
3329
- onabort(new AxiosError("timeout of ".concat(timeout, "ms exceeded"), AxiosError.ETIMEDOUT));
3330
- }, timeout);
3331
- var unsubscribe = function unsubscribe() {
3332
- if (signals) {
3333
- timer && clearTimeout(timer);
3334
- timer = null;
3335
- signals.forEach(function (signal) {
3336
- signal.unsubscribe ? signal.unsubscribe(onabort) : signal.removeEventListener('abort', onabort);
3337
- });
3338
- signals = null;
3339
- }
3340
- };
3358
+ signals = signals ? signals.filter(Boolean) : [];
3359
+ if (!timeout && !signals.length) {
3360
+ return;
3361
+ }
3362
+ var controller = new AbortController();
3363
+ var aborted = false;
3364
+ var onabort = function onabort(reason) {
3365
+ if (!aborted) {
3366
+ aborted = true;
3367
+ unsubscribe();
3368
+ var err = reason instanceof Error ? reason : this.reason;
3369
+ controller.abort(err instanceof AxiosError ? err : new CanceledError(err instanceof Error ? err.message : err));
3370
+ }
3371
+ };
3372
+ var timer = timeout && setTimeout(function () {
3373
+ timer = null;
3374
+ onabort(new AxiosError("timeout of ".concat(timeout, "ms exceeded"), AxiosError.ETIMEDOUT));
3375
+ }, timeout);
3376
+ var unsubscribe = function unsubscribe() {
3377
+ if (!signals) {
3378
+ return;
3379
+ }
3380
+ timer && clearTimeout(timer);
3381
+ timer = null;
3341
3382
  signals.forEach(function (signal) {
3342
- return signal.addEventListener('abort', onabort);
3383
+ signal.unsubscribe ? signal.unsubscribe(onabort) : signal.removeEventListener('abort', onabort);
3343
3384
  });
3344
- var signal = controller.signal;
3345
- signal.unsubscribe = function () {
3346
- return utils$1.asap(unsubscribe);
3347
- };
3348
- return signal;
3349
- }
3385
+ signals = null;
3386
+ };
3387
+ signals.forEach(function (signal) {
3388
+ return signal.addEventListener('abort', onabort);
3389
+ });
3390
+ var signal = controller.signal;
3391
+ signal.unsubscribe = function () {
3392
+ return utils$1.asap(unsubscribe);
3393
+ };
3394
+ return signal;
3350
3395
  };
3351
3396
 
3352
3397
  var streamChunk = /*#__PURE__*/_regenerator().m(function streamChunk(chunk, chunkSize) {
@@ -3644,10 +3689,39 @@
3644
3689
  return bytes;
3645
3690
  }
3646
3691
 
3647
- var VERSION = "1.16.0";
3692
+ var VERSION = "1.17.0";
3648
3693
 
3649
3694
  var DEFAULT_CHUNK_SIZE = 64 * 1024;
3650
3695
  var isFunction = utils$1.isFunction;
3696
+
3697
+ /**
3698
+ * Encode a UTF-8 string to a Latin-1 byte string for use with btoa().
3699
+ * This is a modern replacement for the deprecated unescape(encodeURIComponent(str)) pattern.
3700
+ *
3701
+ * @param {string} str The string to encode
3702
+ *
3703
+ * @returns {string} UTF-8 bytes as a Latin-1 string
3704
+ */
3705
+ var encodeUTF8 = function encodeUTF8(str) {
3706
+ return encodeURIComponent(str).replace(/%([0-9A-F]{2})/gi, function (_, hex) {
3707
+ return String.fromCharCode(parseInt(hex, 16));
3708
+ });
3709
+ };
3710
+
3711
+ // Node's WHATWG URL parser returns `username` and `password` percent-encoded.
3712
+ // Decode before composing the `auth` option so credentials such as
3713
+ // `my%40email.com:pass` are sent as `my@email.com:pass`. Falls back to the
3714
+ // original value for malformed input so a bad encoding never throws.
3715
+ var decodeURIComponentSafe = function decodeURIComponentSafe(value) {
3716
+ if (!utils$1.isString(value)) {
3717
+ return value;
3718
+ }
3719
+ try {
3720
+ return decodeURIComponent(value);
3721
+ } catch (error) {
3722
+ return value;
3723
+ }
3724
+ };
3651
3725
  var test = function test(fn) {
3652
3726
  try {
3653
3727
  for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
@@ -3658,9 +3732,16 @@
3658
3732
  return false;
3659
3733
  }
3660
3734
  };
3735
+ var maybeWithAuthCredentials = function maybeWithAuthCredentials(url) {
3736
+ var protocolIndex = url.indexOf('://');
3737
+ var urlToCheck = url;
3738
+ if (protocolIndex !== -1) {
3739
+ urlToCheck = urlToCheck.slice(protocolIndex + 3);
3740
+ }
3741
+ return urlToCheck.includes('@') || urlToCheck.includes(':');
3742
+ };
3661
3743
  var factory = function factory(env) {
3662
- var _utils$global;
3663
- var globalObject = (_utils$global = utils$1.global) !== null && _utils$global !== void 0 ? _utils$global : globalThis;
3744
+ var globalObject = utils$1.global !== undefined && utils$1.global !== null ? utils$1.global : globalThis;
3664
3745
  var ReadableStream = globalObject.ReadableStream,
3665
3746
  TextEncoder = globalObject.TextEncoder;
3666
3747
  env = utils$1.merge.call({
@@ -3812,13 +3893,16 @@
3812
3893
  }();
3813
3894
  return /*#__PURE__*/function () {
3814
3895
  var _ref4 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee4(config) {
3815
- var _resolveConfig, url, method, data, signal, cancelToken, timeout, onDownloadProgress, onUploadProgress, responseType, headers, _resolveConfig$withCr, withCredentials, fetchOptions, maxContentLength, maxBodyLength, hasMaxContentLength, hasMaxBodyLength, _fetch, composedSignal, request, unsubscribe, requestContentLength, estimated, outboundLength, _request, contentTypeHeader, _progressEventDecorat, _progressEventDecorat2, onProgress, flush, isCredentialsSupported, contentType, resolvedOptions, response, declaredLength, isStreamResponse, options, responseContentLength, _ref5, _ref6, _onProgress, _flush, bytesRead, onChunkProgress, responseData, materializedSize, canceledError, _t3, _t4, _t5;
3896
+ var _resolveConfig, url, method, data, signal, cancelToken, timeout, onDownloadProgress, onUploadProgress, responseType, headers, _resolveConfig$withCr, withCredentials, fetchOptions, maxContentLength, maxBodyLength, hasMaxContentLength, hasMaxBodyLength, own, _fetch, composedSignal, request, unsubscribe, requestContentLength, auth, configAuth, username, password, parsedURL, urlUsername, urlPassword, estimated, outboundLength, _request, contentTypeHeader, _progressEventDecorat, _progressEventDecorat2, onProgress, flush, isCredentialsSupported, contentType, resolvedOptions, response, declaredLength, isStreamResponse, options, responseContentLength, _ref5, _ref6, _onProgress, _flush, bytesRead, onChunkProgress, responseData, materializedSize, canceledError, _t3, _t4, _t5;
3816
3897
  return _regenerator().w(function (_context4) {
3817
3898
  while (1) switch (_context4.p = _context4.n) {
3818
3899
  case 0:
3819
3900
  _resolveConfig = resolveConfig(config), url = _resolveConfig.url, method = _resolveConfig.method, data = _resolveConfig.data, signal = _resolveConfig.signal, cancelToken = _resolveConfig.cancelToken, timeout = _resolveConfig.timeout, onDownloadProgress = _resolveConfig.onDownloadProgress, onUploadProgress = _resolveConfig.onUploadProgress, responseType = _resolveConfig.responseType, headers = _resolveConfig.headers, _resolveConfig$withCr = _resolveConfig.withCredentials, withCredentials = _resolveConfig$withCr === void 0 ? 'same-origin' : _resolveConfig$withCr, fetchOptions = _resolveConfig.fetchOptions, maxContentLength = _resolveConfig.maxContentLength, maxBodyLength = _resolveConfig.maxBodyLength;
3820
3901
  hasMaxContentLength = utils$1.isNumber(maxContentLength) && maxContentLength > -1;
3821
3902
  hasMaxBodyLength = utils$1.isNumber(maxBodyLength) && maxBodyLength > -1;
3903
+ own = function own(key) {
3904
+ return utils$1.hasOwnProp(config, key) ? config[key] : undefined;
3905
+ };
3822
3906
  _fetch = envFetch || fetch;
3823
3907
  responseType = responseType ? (responseType + '').toLowerCase() : 'text';
3824
3908
  composedSignal = composeSignals([signal, cancelToken && cancelToken.toAbortSignal()], timeout);
@@ -3827,6 +3911,41 @@
3827
3911
  composedSignal.unsubscribe();
3828
3912
  };
3829
3913
  _context4.p = 1;
3914
+ // HTTP basic authentication
3915
+ auth = undefined;
3916
+ configAuth = own('auth');
3917
+ if (configAuth) {
3918
+ username = configAuth.username || '';
3919
+ password = configAuth.password || '';
3920
+ auth = {
3921
+ username: username,
3922
+ password: password
3923
+ };
3924
+ }
3925
+ if (maybeWithAuthCredentials(url)) {
3926
+ parsedURL = new URL(url, platform.origin);
3927
+ if (!auth && (parsedURL.username || parsedURL.password)) {
3928
+ urlUsername = decodeURIComponentSafe(parsedURL.username);
3929
+ urlPassword = decodeURIComponentSafe(parsedURL.password);
3930
+ auth = {
3931
+ username: urlUsername,
3932
+ password: urlPassword
3933
+ };
3934
+ }
3935
+ if (parsedURL.username || parsedURL.password) {
3936
+ parsedURL.username = '';
3937
+ parsedURL.password = '';
3938
+ url = parsedURL.href;
3939
+ }
3940
+ }
3941
+ if (auth) {
3942
+ headers["delete"]('authorization');
3943
+ headers.set('Authorization', 'Basic ' + btoa(encodeUTF8((auth.username || '') + ':' + (auth.password || ''))));
3944
+ }
3945
+
3946
+ // Enforce maxContentLength for data: URLs up-front so we never materialize
3947
+ // an oversized payload. The HTTP adapter applies the same check (see http.js
3948
+ // "if (protocol === 'data:')" branch).
3830
3949
  if (!(hasMaxContentLength && typeof url === 'string' && url.startsWith('data:'))) {
3831
3950
  _context4.n = 2;
3832
3951
  break;
@@ -3900,7 +4019,7 @@
3900
4019
  resolvedOptions = _objectSpread2(_objectSpread2({}, fetchOptions), {}, {
3901
4020
  signal: composedSignal,
3902
4021
  method: method.toUpperCase(),
3903
- headers: headers.normalize().toJSON(),
4022
+ headers: toByteStringHeaderObject(headers.normalize()),
3904
4023
  body: data,
3905
4024
  duplex: 'half',
3906
4025
  credentials: isCredentialsSupported ? withCredentials : undefined
@@ -4412,7 +4531,8 @@
4412
4531
  silentJSONParsing: validators.transitional(validators["boolean"]),
4413
4532
  forcedJSONParsing: validators.transitional(validators["boolean"]),
4414
4533
  clarifyTimeoutError: validators.transitional(validators["boolean"]),
4415
- legacyInterceptorReqResOrdering: validators.transitional(validators["boolean"])
4534
+ legacyInterceptorReqResOrdering: validators.transitional(validators["boolean"]),
4535
+ advertiseZstdAcceptEncoding: validators.transitional(validators["boolean"])
4416
4536
  }, false);
4417
4537
  }
4418
4538
  if (paramsSerializer != null) {