axios 1.3.2 → 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.

@@ -1,4 +1,4 @@
1
- // Axios v1.3.2 Copyright (c) 2023 Matt Zabriskie and contributors
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.2";
1955
+ const VERSION = "1.3.3";
1952
1956
 
1953
1957
  function parseProtocol(url) {
1954
1958
  const match = /^([-+\w]{1,25})(:?\/\/|:)/.exec(url);
@@ -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
  }