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/lib/adapters/http.js
CHANGED
@@ -183,7 +183,7 @@ export default isHttpAdapterSupported && function httpAdapter(config) {
|
|
183
183
|
|
184
184
|
// Parse url
|
185
185
|
const fullPath = buildFullPath(config.baseURL, config.url);
|
186
|
-
const parsed = new URL(fullPath);
|
186
|
+
const parsed = new URL(fullPath, 'http://localhost');
|
187
187
|
const protocol = parsed.protocol || supportedProtocols[0];
|
188
188
|
|
189
189
|
if (protocol === 'data:') {
|
@@ -264,7 +264,7 @@ export default isHttpAdapterSupported && function httpAdapter(config) {
|
|
264
264
|
if (!headers.hasContentLength()) {
|
265
265
|
try {
|
266
266
|
const knownLength = await util.promisify(data.getLength).call(data);
|
267
|
-
headers.setContentLength(knownLength);
|
267
|
+
Number.isFinite(knownLength) && knownLength >= 0 && headers.setContentLength(knownLength);
|
268
268
|
/*eslint no-empty:0*/
|
269
269
|
} catch (e) {
|
270
270
|
}
|
package/lib/core/AxiosHeaders.js
CHANGED
@@ -33,11 +33,15 @@ function isValidHeaderName(str) {
|
|
33
33
|
return /^[-_a-zA-Z]+$/.test(str.trim());
|
34
34
|
}
|
35
35
|
|
36
|
-
function matchHeaderValue(context, value, header, filter) {
|
36
|
+
function matchHeaderValue(context, value, header, filter, isHeaderNameFilter) {
|
37
37
|
if (utils.isFunction(filter)) {
|
38
38
|
return filter.call(this, value, header);
|
39
39
|
}
|
40
40
|
|
41
|
+
if (isHeaderNameFilter) {
|
42
|
+
value = header;
|
43
|
+
}
|
44
|
+
|
41
45
|
if (!utils.isString(value)) return;
|
42
46
|
|
43
47
|
if (utils.isString(filter)) {
|
@@ -181,7 +185,7 @@ class AxiosHeaders {
|
|
181
185
|
|
182
186
|
while (i--) {
|
183
187
|
const key = keys[i];
|
184
|
-
if(!matcher || matchHeaderValue(this, this[key], key, matcher)) {
|
188
|
+
if(!matcher || matchHeaderValue(this, this[key], key, matcher, true)) {
|
185
189
|
delete this[key];
|
186
190
|
deleted = true;
|
187
191
|
}
|
package/lib/env/data.js
CHANGED
@@ -1 +1 @@
|
|
1
|
-
export const VERSION = "1.3.
|
1
|
+
export const VERSION = "1.3.3";
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "axios",
|
3
|
-
"version": "1.3.
|
3
|
+
"version": "1.3.3",
|
4
4
|
"description": "Promise based HTTP client for the browser and node.js",
|
5
5
|
"main": "index.js",
|
6
6
|
"exports": {
|
@@ -157,8 +157,7 @@
|
|
157
157
|
"Rikki Gibson (https://github.com/RikkiGibson)",
|
158
158
|
"Remco Haszing (https://github.com/remcohaszing)",
|
159
159
|
"Yasu Flores (https://github.com/yasuf)",
|
160
|
-
"Ben Carp (https://github.com/carpben)"
|
161
|
-
"Daniel Lopretto (https://github.com/timemachine3030)"
|
160
|
+
"Ben Carp (https://github.com/carpben)"
|
162
161
|
],
|
163
162
|
"sideEffects": false,
|
164
163
|
"release-it": {
|