axios 1.15.2 → 1.16.1
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/CHANGELOG.md +103 -6
- package/README.md +396 -25
- package/dist/axios.js +1455 -1109
- package/dist/axios.js.map +1 -1
- package/dist/axios.min.js +3 -3
- package/dist/axios.min.js.map +1 -1
- package/dist/browser/axios.cjs +1569 -1174
- package/dist/browser/axios.cjs.map +1 -1
- package/dist/esm/axios.js +1569 -1173
- package/dist/esm/axios.js.map +1 -1
- package/dist/esm/axios.min.js +2 -2
- package/dist/esm/axios.min.js.map +1 -1
- package/dist/node/axios.cjs +1395 -915
- package/dist/node/axios.cjs.map +1 -1
- package/index.d.cts +25 -13
- package/index.d.ts +21 -4
- package/index.js +2 -0
- package/lib/adapters/adapters.js +4 -2
- package/lib/adapters/fetch.js +131 -11
- package/lib/adapters/http.js +298 -69
- package/lib/adapters/xhr.js +8 -3
- package/lib/core/Axios.js +7 -3
- package/lib/core/AxiosError.js +86 -1
- package/lib/core/AxiosHeaders.js +4 -33
- package/lib/core/dispatchRequest.js +19 -7
- package/lib/core/mergeConfig.js +6 -3
- package/lib/core/settle.js +7 -11
- package/lib/defaults/index.js +1 -1
- package/lib/env/data.js +1 -1
- package/lib/helpers/buildURL.js +1 -1
- package/lib/helpers/composeSignals.js +48 -47
- package/lib/helpers/cookies.js +14 -2
- package/lib/helpers/estimateDataURLDecodedBytes.js +28 -1
- package/lib/helpers/formDataToJSON.js +1 -1
- package/lib/helpers/formDataToStream.js +1 -1
- package/lib/helpers/fromDataURI.js +18 -5
- package/lib/helpers/parseProtocol.js +1 -1
- package/lib/helpers/progressEventReducer.js +3 -0
- package/lib/helpers/resolveConfig.js +33 -17
- package/lib/helpers/sanitizeHeaderValue.js +60 -0
- package/lib/helpers/shouldBypassProxy.js +26 -1
- package/lib/helpers/validator.js +1 -1
- package/lib/utils.js +35 -22
- package/package.json +19 -24
package/CHANGELOG.md
CHANGED
|
@@ -1,6 +1,103 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
-
## v1.
|
|
3
|
+
## v1.16.0 — May 2, 2026
|
|
4
|
+
|
|
5
|
+
This release adds support for the QUERY HTTP method and a new `ECONNREFUSED` error constant, lands a substantial wave of HTTP, fetch, and XHR adapter bug fixes around redirects, aborts, headers, and timeouts, and welcomes 23 new contributors.
|
|
6
|
+
|
|
7
|
+
## ⚠️ Notable Changes
|
|
8
|
+
|
|
9
|
+
A handful of fixes in this release are either security-adjacent or change observable behaviour. Please review before upgrading:
|
|
10
|
+
|
|
11
|
+
- **Fetch adapter now enforces `maxBodyLength` and `maxContentLength`.** These limits were silently ignored on the fetch adapter prior to 1.16.0 — anyone relying on them as a safety net (DoS protection, accidental large uploads) had no protection. (**#10795**)
|
|
12
|
+
- **Proxy requests now preserve user-supplied `Host` headers.** Previously, the proxy path could overwrite a custom `Host`. Virtual-host-style routing through a proxy will now behave correctly. (**#10822**)
|
|
13
|
+
- **Basic auth credentials embedded in URLs are now URL-decoded.** If you have percent-encoded credentials in a URL (e.g. `https://user:p%40ss@host`), the decoded value is what now goes on the wire. (**#10825**)
|
|
14
|
+
- **`parseProtocol` now strictly requires a colon in the protocol separator.** Strings that loosely parsed as protocols before may no longer match. (**#10729**)
|
|
15
|
+
- **Deprecated `unescape()` replaced with modern UTF-8 encoding.** Non-ASCII URL handling is now spec-correct; consumers depending on legacy `unescape()` quirks may see different output bytes. (**#7378**)
|
|
16
|
+
- **`transformRequest` input typing change was reverted.** The typing change introduced in #10745 was reverted in #10810 after follow-up review — net behavior is unchanged from 1.15.2. (**#10745**, **#10810**)
|
|
17
|
+
|
|
18
|
+
## 🚀 New Features
|
|
19
|
+
|
|
20
|
+
- **QUERY HTTP Method:** Added support for the QUERY HTTP method across adapters and type definitions. (**#10802**)
|
|
21
|
+
- **ECONNREFUSED Error Constant:** Exposed `ECONNREFUSED` as a constant on `AxiosError` so callers can match connection-refused failures without comparing string literals (closes #6485). (**#10680**)
|
|
22
|
+
- **Encode Helper Export:** Exported the internal `encode` helper from `buildURL` so userland param serializers can reuse the same encoding logic that axios uses internally. (**#6897**)
|
|
23
|
+
|
|
24
|
+
## 🐛 Bug Fixes
|
|
25
|
+
|
|
26
|
+
- **HTTP Adapter — Redirects & Headers:** Cleared stale headers when a redirect targets a no-proxy host, fixed the redirect listener chain so listeners no longer stack across hops, restored the missing `requestDetails` argument on `beforeRedirect`, preserved user-supplied `Host` headers when forwarding through a proxy, and properly URL-decoded basic auth credentials. (**#10794**, **#10800**, **#6241**, **#10822**, **#10825**)
|
|
27
|
+
- **HTTP Adapter — Streams & Timeouts:** Preserved the partial response object on `AxiosError` when a stream is aborted after headers arrive, honoured the `timeout` option during the connect phase when redirects are disabled, and resolved an unsettled-promise hang when an aborted request was combined with compression and `maxRedirects: 0`. (**#10708**, **#10819**, **#7149**)
|
|
28
|
+
- **Fetch Adapter:** Enforced `maxBodyLength` / `maxContentLength` in the fetch adapter, set the `User-Agent` header to match the HTTP adapter, preserved the original abort reason instead of replacing it with a generic error, and deferred global access so importing the module no longer throws a `TypeError` in restricted environments. (**#10795**, **#10772**, **#10806**, **#7260**)
|
|
29
|
+
- **XHR Adapter:** Unsubscribed the `cancelToken` and `AbortSignal` listeners on the error, timeout, and abort code paths to prevent leaked subscriptions. (**#10787**)
|
|
30
|
+
- **Error Handling:** Attached the parsed response to `AxiosError` when `JSON.parse` fails inside `dispatchRequest`, prevented `settle` from emitting `undefined` error codes, and tightened the `parseProtocol` regex to require a colon in the protocol separator. (**#10724**, **#7276**, **#10729**)
|
|
31
|
+
- **Types & Exports:** Aligned the CommonJS `CancelToken` typings with the ESM build, fixed a compiler error caused by `RawAxiosHeaders`, and re-exported `create` from the package index. (**#7414**, **#6389**, **#6460**)
|
|
32
|
+
- **UTF-8 Encoding:** Replaced the deprecated `unescape()` call with a modern UTF-8 encoding implementation. (**#7378**)
|
|
33
|
+
- **Misc Cleanup:** Resolved a batch of small inconsistencies and gadget-level issues across the codebase. (**#10833**)
|
|
34
|
+
|
|
35
|
+
## 🔧 Maintenance & Chores
|
|
36
|
+
|
|
37
|
+
- **Refactor — ES6 Modernisation:** Modernised the `utils` module and XHR adapter to use ES6 features, and tidied the multipart boundary error message. (**#10588**, **#7419**)
|
|
38
|
+
- **Tests:** Hardened the HTTP test server lifecycle to fix flaky `FormData` EPIPE failures, fixed Win32 platform support for the pipe tests, and corrected an incorrect test assumption. (**#10820**, **#10791**, **#10796**)
|
|
39
|
+
- **Docs:** Documented `paramsSerializer.encode` for strict RFC 3986 query encoding, updated the `parseReviver` TypeScript definitions and configuration docs for ES2023, added timeout guidance to the README's first async example, and expanded notes around the recent type changes. (**#10821**, **#10782**, **#10759**, **#10804**)
|
|
40
|
+
- **Reverted:** Reverted the `transformRequest` input typing change from #10745 after follow-up review. (**#10745**, **#10810**)
|
|
41
|
+
- **Dependencies:** Bumped `actions/setup-node`, the `github-actions` group, and `postcss` (in `/docs`) to their latest versions. (**#10785**, **#10813**, **#10814**)
|
|
42
|
+
- **Release:** Updated changelog and packages, and prepared the 1.16.0 release. (**#10790**, **#10834**)
|
|
43
|
+
|
|
44
|
+
## 🌟 New Contributors
|
|
45
|
+
|
|
46
|
+
We are thrilled to welcome our new contributors. Thank you for helping improve axios:
|
|
47
|
+
|
|
48
|
+
- **@singhankit001** (**#10588**)
|
|
49
|
+
- **@cuiweixie** (**#7419**)
|
|
50
|
+
- **@iruizsalinas** (**#10787**)
|
|
51
|
+
- **@MarcosNocetti** (**#10680**)
|
|
52
|
+
- **@deepview-autofix** (**#10729**)
|
|
53
|
+
- **@atharvasingh7007** (**#10745**)
|
|
54
|
+
- **@OfekDanny** (**#10772**)
|
|
55
|
+
- **@mnahkies** (**#7414**)
|
|
56
|
+
- **@tboyila** (**#10759**)
|
|
57
|
+
- **@Kingo64** (**#6897**)
|
|
58
|
+
- **@ramram1048** (**#6389**)
|
|
59
|
+
- **@FLNacif** (**#6460**)
|
|
60
|
+
- **@zozo123** (**#10806**)
|
|
61
|
+
- **@pierluigilenoci** (**#10802**)
|
|
62
|
+
- **@afurm** (**#10708**)
|
|
63
|
+
- **@karan-lrn** (**#7378**)
|
|
64
|
+
- **@ebeigarts** (**#7149**)
|
|
65
|
+
- **@Raymondo97** (**#10782**)
|
|
66
|
+
- **@mixelburg** (**#10821**)
|
|
67
|
+
- **@ashishkr96** (**#10822**)
|
|
68
|
+
- **@cyphercodes** (**#10819**)
|
|
69
|
+
- **@Jye10032** (**#7260**)
|
|
70
|
+
- **@VeerShah41** (**#7276**)
|
|
71
|
+
|
|
72
|
+
[Full Changelog](https://github.com/axios/axios/compare/v1.15.2...v1.16.0)
|
|
73
|
+
|
|
74
|
+
## v1.15.2 - April 21, 2026
|
|
75
|
+
|
|
76
|
+
This release delivers prototype-pollution hardening for the Node HTTP adapter, adds an opt-in `allowedSocketPaths` allowlist to mitigate SSRF via Unix domain sockets, fixes a keep-alive socket memory leak, and ships supply-chain hardening across CI and security docs.
|
|
77
|
+
|
|
78
|
+
## 🔒 Security Fixes
|
|
79
|
+
|
|
80
|
+
- **Prototype Pollution Hardening (HTTP Adapter):** Hardened the Node HTTP adapter and `resolveConfig`/`mergeConfig`/validator paths to read only own properties and use null-prototype config objects, preventing polluted `auth`, `baseURL`, `socketPath`, `beforeRedirect`, and `insecureHTTPParser` from influencing requests. (**#10779**)
|
|
81
|
+
- **SSRF via `socketPath`:** Rejects non-string `socketPath` values and adds an opt-in `allowedSocketPaths` config option to restrict permitted Unix domain socket paths, returning `AxiosError` `ERR_BAD_OPTION_VALUE` on mismatch. (**#10777**)
|
|
82
|
+
- **Supply-chain Hardening:** Added `.npmrc` with `ignore-scripts=true`, lockfile lint CI, non-blocking reproducible build diff, scoped CODEOWNERS, expanded `SECURITY.md`/`THREATMODEL.md` with provenance verification (`npm audit signatures`), 60-day resolution policy, and maintainer incident-response runbook. (**#10776**)
|
|
83
|
+
|
|
84
|
+
## 🚀 New Features
|
|
85
|
+
|
|
86
|
+
- **`allowedSocketPaths` Config Option:** New request config option (and TypeScript types) to allowlist Unix domain socket paths used by the Node http adapter; backwards compatible when unset. (**#10777**)
|
|
87
|
+
|
|
88
|
+
## 🐛 Bug Fixes
|
|
89
|
+
|
|
90
|
+
- **Keep-alive Socket Memory Leak:** Installs a single per-socket `error` listener tracking the active request via `kAxiosSocketListener`/`kAxiosCurrentReq`, eliminating per-request listener accumulation, `MaxListenersExceededWarning`, and linear heap growth under concurrent or long-running keep-alive workloads (fixes #10780). (**#10788**)
|
|
91
|
+
|
|
92
|
+
## 🔧 Maintenance & Chores
|
|
93
|
+
|
|
94
|
+
- **Changelog:** Updated `CHANGELOG.md` with v1.15.1 release notes. (**#10781**)
|
|
95
|
+
|
|
96
|
+
[Full Changelog](https://github.com/axios/axios/compare/v1.15.1...v1.15.2)
|
|
97
|
+
|
|
98
|
+
---
|
|
99
|
+
|
|
100
|
+
## v1.15.1 - April 19, 2026
|
|
4
101
|
|
|
5
102
|
This release ships a coordinated set of security hardening fixes across headers, body/redirect limits, multipart handling, and XSRF/prototype-pollution vectors, alongside a broad sweep of bug fixes, test migrations, and threat-model documentation updates.
|
|
6
103
|
|
|
@@ -68,7 +165,7 @@ We are thrilled to welcome our new contributors. Thank you for helping improve a
|
|
|
68
165
|
|
|
69
166
|
---
|
|
70
167
|
|
|
71
|
-
## v1.15.0
|
|
168
|
+
## v1.15.0 - April 7, 2026
|
|
72
169
|
|
|
73
170
|
This release delivers two critical security patches targeting header injection and SSRF via proxy bypass, adds official runtime support for Deno and Bun, and includes significant CI security hardening.
|
|
74
171
|
|
|
@@ -108,7 +205,7 @@ We are thrilled to welcome our new contributors. Thank you for helping improve a
|
|
|
108
205
|
|
|
109
206
|
---
|
|
110
207
|
|
|
111
|
-
## v1.14.0
|
|
208
|
+
## v1.14.0 - March 27, 2026
|
|
112
209
|
|
|
113
210
|
This release fixes a security vulnerability in the `formidable` dependency, resolves a CommonJS compatibility regression, hardens proxy and HTTP/2 handling, and modernises the build and test toolchain.
|
|
114
211
|
|
|
@@ -146,7 +243,7 @@ We are thrilled to welcome our new contributors. Thank you for helping improve a
|
|
|
146
243
|
|
|
147
244
|
---
|
|
148
245
|
|
|
149
|
-
## v1.13.6
|
|
246
|
+
## v1.13.6 - February 27, 2026
|
|
150
247
|
|
|
151
248
|
This release adds React Native Blob support, fixes several enumeration and export regressions, and patches FormData detection for WeChat Mini Program environments.
|
|
152
249
|
|
|
@@ -182,7 +279,7 @@ We are thrilled to welcome our new contributors. Thank you for helping improve a
|
|
|
182
279
|
|
|
183
280
|
---
|
|
184
281
|
|
|
185
|
-
## v1.13.5
|
|
282
|
+
## v1.13.5 - February 8, 2026
|
|
186
283
|
|
|
187
284
|
This release patches a prototype pollution denial-of-service vulnerability, fixes a missing `status` field regression in `AxiosError`, adds interceptor ordering control, and introduces URL validation for `isAbsoluteURL`.
|
|
188
285
|
|
|
@@ -216,7 +313,7 @@ We are thrilled to welcome our new contributors. Thank you for helping improve a
|
|
|
216
313
|
|
|
217
314
|
---
|
|
218
315
|
|
|
219
|
-
## v1.13.4
|
|
316
|
+
## v1.13.4 - January 27, 2026
|
|
220
317
|
|
|
221
318
|
Patch release fixing regressions introduced in v1.13.3, including TypeScript export compatibility and CI/build stability.
|
|
222
319
|
|