axios 1.3.1 → 1.3.3
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.
Potentially problematic release.
This version of axios might be problematic. Click here for more details.
- package/CHANGELOG.md +26 -0
- package/dist/axios.js +8 -5
- package/dist/axios.js.map +1 -1
- package/dist/axios.min.js +1 -1
- package/dist/axios.min.js.map +1 -1
- package/dist/browser/axios.cjs +9 -5
- package/dist/browser/axios.cjs.map +1 -1
- package/dist/esm/axios.js +9 -5
- package/dist/esm/axios.js.map +1 -1
- package/dist/esm/axios.min.js +1 -1
- package/dist/esm/axios.min.js.map +1 -1
- package/dist/node/axios.cjs +11 -7
- package/dist/node/axios.cjs.map +1 -1
- package/lib/adapters/http.js +2 -2
- package/lib/core/AxiosHeaders.js +6 -2
- package/lib/env/data.js +1 -1
- package/lib/helpers/formDataToStream.js +1 -0
- package/lib/platform/browser/classes/FormData.js +1 -1
- package/package.json +2 -3
package/dist/node/axios.cjs
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
// Axios v1.3.
|
1
|
+
// Axios v1.3.3 Copyright (c) 2023 Matt Zabriskie and contributors
|
2
2
|
'use strict';
|
3
3
|
|
4
4
|
const FormData$1 = require('form-data');
|
@@ -1581,11 +1581,15 @@ function isValidHeaderName(str) {
|
|
1581
1581
|
return /^[-_a-zA-Z]+$/.test(str.trim());
|
1582
1582
|
}
|
1583
1583
|
|
1584
|
-
function matchHeaderValue(context, value, header, filter) {
|
1584
|
+
function matchHeaderValue(context, value, header, filter, isHeaderNameFilter) {
|
1585
1585
|
if (utils.isFunction(filter)) {
|
1586
1586
|
return filter.call(this, value, header);
|
1587
1587
|
}
|
1588
1588
|
|
1589
|
+
if (isHeaderNameFilter) {
|
1590
|
+
value = header;
|
1591
|
+
}
|
1592
|
+
|
1589
1593
|
if (!utils.isString(value)) return;
|
1590
1594
|
|
1591
1595
|
if (utils.isString(filter)) {
|
@@ -1729,7 +1733,7 @@ class AxiosHeaders {
|
|
1729
1733
|
|
1730
1734
|
while (i--) {
|
1731
1735
|
const key = keys[i];
|
1732
|
-
if(!matcher || matchHeaderValue(this, this[key], key, matcher)) {
|
1736
|
+
if(!matcher || matchHeaderValue(this, this[key], key, matcher, true)) {
|
1733
1737
|
delete this[key];
|
1734
1738
|
deleted = true;
|
1735
1739
|
}
|
@@ -1948,7 +1952,7 @@ function buildFullPath(baseURL, requestedURL) {
|
|
1948
1952
|
return requestedURL;
|
1949
1953
|
}
|
1950
1954
|
|
1951
|
-
const VERSION = "1.3.
|
1955
|
+
const VERSION = "1.3.3";
|
1952
1956
|
|
1953
1957
|
function parseProtocol(url) {
|
1954
1958
|
const match = /^([-+\w]{1,25})(:?\/\/|:)/.exec(url);
|
@@ -2288,7 +2292,7 @@ const readBlob$1 = readBlob;
|
|
2288
2292
|
|
2289
2293
|
const BOUNDARY_ALPHABET = utils.ALPHABET.ALPHA_DIGIT + '-_';
|
2290
2294
|
|
2291
|
-
const textEncoder = new TextEncoder();
|
2295
|
+
const textEncoder = new util.TextEncoder();
|
2292
2296
|
|
2293
2297
|
const CRLF = '\r\n';
|
2294
2298
|
const CRLF_BYTES = textEncoder.encode(CRLF);
|
@@ -2577,7 +2581,7 @@ const httpAdapter = isHttpAdapterSupported && function httpAdapter(config) {
|
|
2577
2581
|
|
2578
2582
|
// Parse url
|
2579
2583
|
const fullPath = buildFullPath(config.baseURL, config.url);
|
2580
|
-
const parsed = new URL(fullPath);
|
2584
|
+
const parsed = new URL(fullPath, 'http://localhost');
|
2581
2585
|
const protocol = parsed.protocol || supportedProtocols[0];
|
2582
2586
|
|
2583
2587
|
if (protocol === 'data:') {
|
@@ -2658,7 +2662,7 @@ const httpAdapter = isHttpAdapterSupported && function httpAdapter(config) {
|
|
2658
2662
|
if (!headers.hasContentLength()) {
|
2659
2663
|
try {
|
2660
2664
|
const knownLength = await util__default["default"].promisify(data.getLength).call(data);
|
2661
|
-
headers.setContentLength(knownLength);
|
2665
|
+
Number.isFinite(knownLength) && knownLength >= 0 && headers.setContentLength(knownLength);
|
2662
2666
|
/*eslint no-empty:0*/
|
2663
2667
|
} catch (e) {
|
2664
2668
|
}
|