2
0
mirror of https://github.com/tenrok/axios.git synced 2026-05-15 11:59:42 +03:00
Commit Graph

382 Commits

Author SHA1 Message Date
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
Dmitriy Mozgovoy a3ff99b59d feat(adapter): add fetch adapter; (#6371) 2024-04-28 22:33:49 +03:00
Dmitriy Mozgovoy 1a08f90f40 fix: capture async stack only for rejections with native error objects; (#6203) 2024-01-25 20:42:38 +02:00
Zao Soula a1938ff073 fix: fixed missed dispatchBeforeRedirect argument (#5778)
Co-authored-by: Dmitriy Mozgovoy <robotshara@gmail.com>
2024-01-25 00:57:06 +02:00
Ilya Priven 123f354b92 fix: wrap errors to improve async stack trace (#5987) 2024-01-25 00:21:12 +02:00
Dmitriy Mozgovoy f4f2b039dd fix(dns): fixed lookup error handling; (#6175) 2024-01-05 01:48:07 +02:00
Dmitriy Mozgovoy 3c0c11cade fix(security): fixed formToJSON prototype pollution vulnerability; (#6167) 2024-01-03 21:37:32 +02:00
Guy Nesher 75af1cdff5 fix(security): fixed security vulnerability in follow-redirects (#6163)
Co-authored-by: Jay <jasonsaayman@gmail.com>
2024-01-03 21:32:50 +02:00
Willian Agostini 5e7ad38fb0 fix: Regular Expression Denial of Service (ReDoS) (#6132) 2023-12-26 22:29:26 +02:00
Dmitriy Mozgovoy cff996779b feat(withXSRFToken): added withXSRFToken option as a workaround to achieve the old withCredentials behavior; (#6046) 2023-11-14 15:38:25 +02:00
Valentin Panov 96ee232bd3 fix(CSRF): fixed CSRF vulnerability CVE-2023-45857 (#6028)
Co-authored-by: DigitalBrainJS <robotshara@gmail.com>
2023-10-26 22:54:06 +03:00
Dmitriy Mozgovoy 7d45ab2e2a chore(tests): fixed tests to pass in node v19 and v20 with keep-alive enabled; (#6021) 2023-10-22 18:20:44 +03:00
Dmitriy Mozgovoy 5aaff532a6 fix(dns): fixed lookup function decorator to work properly in node v20; (#6011) 2023-10-22 17:12:33 +03:00
Dmitriy Mozgovoy e4107797a7 fix(adapters): improved adapters loading logic to have clear error messages; (#5919) 2023-09-26 19:43:25 +03:00
Przemyslaw Motacki 4c89f25196 fix(headers): allow content-encoding header to handle case-insensitive values (#5890) (#5892) 2023-09-12 15:23:03 +03:00
夜葬 ca73eb878d feat: export getAdapter function (#5324) 2023-08-26 20:42:25 +03:00
Dmitriy Mozgovoy 8fda2766b1 fix(headers): fixed common Content-Type header merging; (#5832) 2023-08-26 16:26:50 +03:00
Dmitriy Mozgovoy d8b4ca0ea5 fix(headers): added support for setting header names that overlap with class methods; (#5831) 2023-08-25 21:07:51 +03:00
PIYUSH NEGI e18fdd893d refactor: remove deprecated url-search-params polyfill for URLSearchParams (#5670) 2023-04-28 00:58:07 +03:00