Jay
a4230f5581
Revert "fix: silentJSONParsing=false should throw on invalid JSON ( #7253 ) (#7…" ( #7298 )
...
This reverts commit 7d19335e43 .
2025-12-08 14:19:20 +02:00
Nandan Acharya
e0a120620e
test: add Node unit tests for toFormData and refactor buildURL to avoid param reassignment ( #7272 )
...
Co-authored-by: Jay <jasonsaayman@gmail.com >
2025-12-08 08:22:30 +02:00
Rudransh
7d19335e43
fix: silentJSONParsing=false should throw on invalid JSON ( #7253 ) ( #7257 )
...
Co-authored-by: Rudransh Gupta <rudranshgupta@Rudranshs-MacBook-Pro.local >
Co-authored-by: Jay <jasonsaayman@gmail.com >
2025-12-06 10:45:54 +02:00
Justin Dhillon
4d06112452
style: turn '()=>' into '() =>' ( #6324 )
...
Co-authored-by: Jay <jasonsaayman@gmail.com >
2025-11-12 21:49:37 +02:00
Gabriel Quaresma
6ef867e684
fix: unclear error message is thrown when specifying an empty proxy authorization ( #6314 )
...
* fix: add AxiosError to Invalid proxy authorization
* fix: minor update
* Update test/unit/adapters/http.js
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com >
* chore: remove redundant check
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com >
* chore: code style
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com >
* chore: style
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com >
* chore: correct assert
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com >
---------
Co-authored-by: João Gabriel Quaresma de Almeida <joaoGabriel55>
Co-authored-by: Jay <jasonsaayman@gmail.com >
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com >
2025-11-12 21:04:39 +02:00
JohnTitor
15bf9563f6
test: correct relationship between filename and test codes ( #6155 )
...
Co-authored-by: zhangh-cs <zhangh-cs@glodon.com >
Co-authored-by: Jay <jasonsaayman@gmail.com >
2025-11-12 08:16:59 +02:00
Julian Dax
1c6a86dd2c
fix: turn AxiosError into a native error ( #5394 ) ( #5558 )
...
* fix: turn AxiosError into a native error (#5394 )
Being an object returned by the 'Error' constructor turns something into a 'native error'.
* fix: simplify code in AxiosError
* fix: simplify code in AxiosError
* refactor: implement AxiosError as a class
* refactor: implement CanceledError as a class
This turns CanceledError into a native error.
* refactor: simplify AxiosError.toJSON
* fix: improve error code handling in `AxiosError.from`
If no error code is provided, use the code from the underlying error.
* fix: set error status in `AxiosError.constructor`
If a response is passed to the constructor, set the response status as a property.
* fix: remove unnecessary async
---------
Co-authored-by: Jay <jasonsaayman@gmail.com >
2025-11-11 19:06:10 +02:00
Dmitriy Mozgovoy
8d372335f5
fix(http): fix 'socket hang up' bug for keep-alive requests when using timeouts; ( #7206 )
2025-11-04 01:08:35 +02:00
Dmitriy Mozgovoy
bcd5581d20
fix(http): fixed a regression that caused the data stream to be interrupted for responses with non-OK HTTP statuses; ( #7193 )
2025-10-28 20:44:08 +02:00
Dmitriy Mozgovoy
d000fbfd07
fix(http2): fix possible race condition when handling http2 stream on almost timed out session by improving timeout out algorithm; ( #7186 )
2025-10-27 00:46:40 +02:00
Dmitriy Mozgovoy
d676df7722
feat(http): add HTTP2 support; ( #7150 )
2025-10-19 15:06:36 +03:00
Kian-Meng Ang
54a1fcc1b6
docs: fix typos ( #7046 )
...
Found via `typos --hidden --format brief`
2025-09-19 15:01:16 +02:00
Dmitriy Mozgovoy
cf78825e12
fix(fetch): use current global fetch instead of cached one when env fetch is not specified to keep MSW support; ( #7030 )
2025-09-13 23:24:16 +03:00
Dmitriy Mozgovoy
9fb41a8fcd
chore(ci): add local HTTP server for Karma tests; ( #7022 )
2025-09-13 17:50:32 +03:00
Ameer Assadi
945435fc51
fix(node): enforce maxContentLength for data: URLs ( #7011 )
...
* fix(node): enforce maxContentLength for data: URLs (pre-decode size check)- CVE-2025-58754
* feat(utils): add estimateDataURLDecodedBytes helper and fix duplicate condition in base64 padding check
* feat: add estimateDataURLDecodedBytes helper with tests
2025-09-10 15:08:43 +02:00
Dmitriy Mozgovoy
c959ff2901
feat(fetch): add fetch, Request, Response env config variables for the adapter; ( #7003 )
...
* feat(fetch): add fetch, Request, Response env config variables for the adapter;
* feat(fetch): fixed design issue for environments without fetch API globals;
2025-08-30 22:02:24 +03:00
Emiedonmokumo Dick-Boro
a9f47afbf3
fix(fetch-adapter): set correct Content-Type for Node FormData ( #6998 )
...
* fix(fetch-adapter): set correct Content-Type for Node FormData
* Update lib/helpers/resolveConfig.js
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com >
* test(fetch): replace chai expect with Node assert
* fix: define formHeaders for FormData to resolve no-undef error
* fix: filter headers to only update the target headers
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com >
---------
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com >
Co-authored-by: Jay <jasonsaayman@gmail.com >
2025-08-25 20:46:53 +02:00
Willian Agostini
2a9763426e
feat: support reviver on JSON.parse ( #5926 )
...
* test: test to support reviver on JSON.parse
* feat: support reviver for JSON.parse on parse response data
#5924
---------
Co-authored-by: Jay <jasonsaayman@gmail.com >
2025-08-12 09:34:42 +02:00
Willian Agostini
7960d34ede
feat(types): extend AxiosResponse interface to include custom headers type ( #6782 )
2025-08-12 09:29:02 +02:00
최예찬
6d84189349
fix(params): removing '[' and ']' from URL encode exclude characters ( #3316 ) ( #5715 )
...
Co-authored-by: Jay <jasonsaayman@gmail.com >
2025-08-01 20:44:47 +02:00
khani
78b290c57c
feat(adapter): surface low‑level network error details; attach original error via cause ( #6982 )
...
* feat(adapter): surface low‑level network error details; attach original error via `cause`
Node http adapter:
- Promote low-level `err.code` to `AxiosError.code`, prefixing message (e.g. `ECONNREFUSED – …`)
- Keep original error on standard `Error.cause`
XHR adapter:
- Preserve browser `ProgressEvent` on `error.event`
- Use event message when available
Tests:
- Add Node ESM tests under `test/unit/adapters` to assert `code` and `cause` behavior
Types:
- Ensure `AxiosError.cause?: unknown` and `event?: ProgressEvent` are present
* fix(adapter): use fs instead of fs/promises for sync file read in tests to fix GitHub Actions
2025-07-30 09:57:27 +02:00
Manish Sahani
a2214ca1bc
fix: prevent RangeError when using large Buffers ( #6961 )
2025-07-15 20:18:24 +02:00
Noritaka Kobayashi
ee7799e13c
refactor: remove unused import in test ( #6922 )
...
Co-authored-by: Jay <jasonsaayman@gmail.com >
2025-06-01 18:31:50 +02:00
Noritaka Kobayashi
eb0a2db04b
chore: fix typos in test ( #6923 )
...
Co-authored-by: Jay <jasonsaayman@gmail.com >
2025-06-01 18:28:07 +02:00
Dmitriy Mozgovoy
f7a3b5e0f7
fix(headers): fixed support for setting multiple header values from an iterated source; ( #6885 )
2025-04-23 19:24:08 +03:00
Dmitriy Mozgovoy
6c5d4cd692
fix(core): fix the Axios constructor implementation to treat the config argument as optional; ( #6881 )
2025-04-18 02:22:31 +03:00
Dmitriy Mozgovoy
1b1f9ccdc1
fix(headers): allow iterable objects to be a data source for the set method; ( #6873 )
2025-04-14 21:55:27 +03:00
George Cheng
d1178cad4c
chore(types): move AxiosStatic#create to AxiosInstance#create ( #5096 )
...
* Add the bad test case.
* Fix and pass the test
* Update index.d.cts
---------
Co-authored-by: Jay <jasonsaayman@gmail.com >
2025-03-31 21:00:51 +02:00
Willian Agostini
80ea756e72
feat(AxiosHeaders): add getSetCookie method to retrieve set-cookie headers values ( #5707 )
...
* feat(AxiosHeaders): add getSetCookie method to retrieve set-cookie header values
* refactor(AxiosHeaders.js): use logical OR instead of nullish coalescing operator in getSetCookie method
---------
Co-authored-by: Willian Agostini <willian.agostini@gmail.com.br >
Co-authored-by: Jay <jasonsaayman@gmail.com >
2025-03-25 21:30:23 +02:00
Marc Hassan
f10c2e0de7
fix(buildFullPath): handle allowAbsoluteUrls: false without baseURL ( #6833 )
...
Co-authored-by: Jay <jasonsaayman@gmail.com >
2025-03-18 20:01:37 +02:00
StefanBRas
10fa70ef14
fix: add missing type for allowAbsoluteUrls ( #6818 )
...
* fix: add missing type for allowAbsoluteUrls
* fix: use semicolon in type files
---------
Co-authored-by: Jay <jasonsaayman@gmail.com >
2025-03-10 19:22:36 +02:00
Marc Hassan
ec159e507b
fix(xhr/fetch): pass allowAbsoluteUrls to buildFullPath in xhr and fetch adapters ( #6814 )
2025-03-10 14:29:41 +02:00
Dmitriy Mozgovoy
36a5a620be
fix(utils): move generateString to platform utils to avoid importing crypto module into client builds; ( #6789 )
...
* chore(ci): Add release-it script;
* fix(utils): move generateString util to platform utils to avoid importing crypto module into client build;
---------
Co-authored-by: Jay <jasonsaayman@gmail.com >
2025-02-26 10:30:55 +02:00
Willian Agostini
23a25af068
fix(utils): replace getRandomValues with crypto module ( #6788 )
2025-02-18 14:36:51 +02:00
Michael Toscano
32c7bcc0f2
feat: Add config for ignoring absolute URLs ( #5902 ) ( #6192 )
...
* fix: prevent request url override
prevent request URL from overriding preconfigured base URL
BREAKING CHANGE: code relying on the above will now combine the URLs instead of prefer request URL
* feat: add config option for allowing absolute URLs
* fix: add default value for allowAbsoluteUrls in buildFullPath
* fix: typo in flow control when setting allowAbsoluteUrls
* feat: update tests supporting issue #5902 functionality
* feat: update README.md with allowAbsoluteUrls
* fix: properly group conditions in buildFullPath.js to avoid undefined error when baseUrl undefined
* Update README.md fix typo
* fix: update build full path logic to address failing test case
* fix: update base URL test
* fix: remove problem test (works locally, will not work in the pipeline)
* fix: update https test to use github.com instead of google.com
* fix: revert previous commit
* fix: add back problem test
* chore: remove un-needed passed var to URL class instanciation
---------
Co-authored-by: Austin Ryan Lawson <ryan.lawson2@gmail.com >
Co-authored-by: Jay <jasonsaayman@gmail.com >
2025-02-12 11:09:24 +02:00
Habip Akyol
30966a79cb
docs(type): fix typo in index.ts ( #6030 )
...
docs(type): fix typo in index.ts (#6030 )
2025-02-02 16:41:49 +02:00
Naron
e7a9cbe3be
test(transform): add test case for issue 5853 on response type to 'json' ( #5901 )
...
* test(transform): add test case for issue 5853 on response type to 'json'
* test(transform): formatted second argument
---------
Co-authored-by: Jay <jasonsaayman@gmail.com >
2025-02-02 16:33:16 +02:00
Tommaso Paulon
eac4619fe2
fix: allow passing a callback as paramsSerializer to buildURL ( #6680 )
...
* fix: allow passing a callback as paramsSerializer to buildURL
* fix: add missing semicolon
2024-11-12 17:33:33 +02:00
Taylor Flatt
cc3217a612
fix: updated stream aborted error message to be more clear ( #6615 )
2024-09-28 13:04:22 +02:00
Ell Bradshaw
8f3cde11d2
Warn about common option misspellings ( #6489 )
...
* chore(tests): add failing tests for baseUrl
* chore(tests): simplify to just warning
* feat: warn about likely-misspelled options
* chore: add semi-colon
* chore: add missing semi-colons
---------
Co-authored-by: Ell Bradshaw <ell@c9a.co >
Co-authored-by: Jay <jasonsaayman@gmail.com >
2024-09-26 21:31:24 +02:00
Rishi556
364993f0d8
fix(http): fixed support for IPv6 literal strings in url ( #5731 )
2024-09-01 00:47:25 +03:00
Dmitriy Mozgovoy
df9889b83c
fix(fetch): optimize signals composing logic; ( #6582 )
2024-08-30 21:26:12 +03:00
Dmitriy Mozgovoy
6700a8adac
fix(core): add the missed implementation of AxiosError#status property; ( #6573 )
2024-08-23 15:58:38 +03:00
Antonin Bas
7004707c41
fix(adapter): fix undefined reference to hasBrowserEnv ( #6572 )
2024-08-23 15:23:14 +03:00
Lev Pachmanov
6b6b605eaf
fix(sec): CVE-2024-39338 ( #6539 ) ( #6543 )
...
* fix(sec): cve-2024-39338 (#6539 )
* fix(sec): fix test
2024-08-13 20:43:05 +02:00
Đỗ Trọng Hải
07a661a2a6
fix(sec): disregard protocol-relative URL to remediate SSRF ( #6539 )
...
* fix(sec): disregard protocol-relative URL to remediate SSRF
Signed-off-by: hainenber <dotronghai96@gmail.com >
* feat(test/unit/regression): add regression test to ensure SNYK-JS-AXIOS-7361793 fixed in future version
Signed-off-by: hainenber <dotronghai96@gmail.com >
* chore: add EoF newline + comments
Signed-off-by: hainenber <dotronghai96@gmail.com >
* chore: fix eslint issues
Signed-off-by: hainenber <dotronghai96@gmail.com >
* Update SNYK-JS-AXIOS-7361793.js
Co-authored-by: tom-reinders <tom-reinders@users.noreply.github.com >
---------
Signed-off-by: hainenber <dotronghai96@gmail.com >
Co-authored-by: tom-reinders <tom-reinders@users.noreply.github.com >
2024-08-13 17:03:25 +02:00
Dmitriy Mozgovoy
e3c76fc9bd
fix(adapter): fix progress event emitting; ( #6518 )
2024-08-01 16:59:58 +03:00
Dmitriy Mozgovoy
870e0a76f6
fix(fetch): fix headers getting from a stream response; ( #6401 )
2024-05-19 01:40:21 +03:00
Dmitriy Mozgovoy
bb5f9a5ab7
fix(fetch): treat fetch-related TypeError as an AxiosError.ERR_NETWORK error; ( #6380 )
2024-05-07 21:26:46 +03:00
Alexandre ABRIOUX
81e0455b7b
fix(core/axios): handle un-writable error stack ( #6362 )
...
Co-authored-by: Dmitriy Mozgovoy <robotshara@gmail.com >
2024-05-07 20:57:03 +03:00