Commit Graph

151 Commits

Author SHA1 Message Date
eason
f372f07ec5
Merge 05d15386a7 into c7a76ddbf2 2026-04-09 16:02:30 -07:00
Nitya Jain
f53ebf2198
fix(core): use strict equality in buildFullPath check (#7252)
Replace loose equality (==) with strict equality (===)

Co-authored-by: Jay <jasonsaayman@gmail.com>
2026-04-07 19:48:21 +02:00
Jay
363185461b
fix: unrestricted cloud metadata exfiltration via header injection chain (#10660)
* fix: unrestricted cloud metadata exfiltration via header injection chain

* fix: address pattern issue highlighted by cubic

* fix: code ql feedback

* fix: code ql feedback
2026-04-06 14:01:54 +02:00
easonysliu
05d15386a7 fix: make AxiosError.cause non-enumerable to prevent circular reference in JSON.stringify 2026-03-17 17:11:47 +08:00
Jay
8077435407
refactor: update eslint to v10 (#7509)
* refactor: update eslint to v10

* chore: fix cubic feedback
2026-03-15 19:08:58 +02:00
Eve
688826facd
fix(headers): trim trailing CRLF in normalized header values (#7456) 2026-03-01 17:48:03 +02:00
Denis Frenademetz
d51accbea1
fix(core): copy status from source error in AxiosError.from (#7403)
When creating an AxiosError from an existing error without a response object,
the status property from the source error is now preserved. This ensures error
status information is not lost during error conversion.

Fixes #7364

Co-authored-by: Jay <jasonsaayman@gmail.com>
2026-02-18 19:33:28 +02:00
Alexander Gehres
822e3e40b4
fix: make AxiosError.message property enumerable (#7392)
* fix: make AxiosError.message property enumerable

Restores backward compatibility by making the message property
enumerable. In v1.13.3, the refactoring to extend native Error
made message non-enumerable, breaking code that uses Object.keys(),
Object.entries(), or spread operator on AxiosError instances.

This fix uses Object.defineProperty to explicitly make the message
property enumerable while maintaining the benefits of extending
the native Error class.

Breaking change introduced in: v1.13.3 (commit 1c6a86d)
Affects: Object.keys(), Object.entries(), spread operator, for...in loops

* chore: build fix

---------

Co-authored-by: Alexander Gehres <alexander.gehres@sap.com>
Co-authored-by: Jay <jasonsaayman@gmail.com>
2026-02-14 17:31:52 +02:00
Jay
ef3711d1b3
feat: implement prettier and fix all issues (#7385)
* feat: implement prettier and fix all issues

* fix: failing tests

* fix: implement feedback from codel, ai etc

* chore: dont throw in trim function

Co-authored-by: cubic-dev-ai[bot] <191113872+cubic-dev-ai[bot]@users.noreply.github.com>

* fix: incorrect fix

---------

Co-authored-by: cubic-dev-ai[bot] <191113872+cubic-dev-ai[bot]@users.noreply.github.com>
2026-02-14 16:59:48 +02:00
Jay
28c721588c
fix: Denial of Service via __proto__ Key in mergeConfig (#7369)
* fix: sec issue as per advisory

* chore: expand and add tests
2026-02-04 20:25:06 +02:00
Willian Agostini
569f028a58
fix: added a option to choose between legacy and the new request/response interceptor ordering
* test: add request interceptor tests for legacy and ordered execution

* feat: add legacy interceptor request/response ordering option

---------

Co-authored-by: Jay <jasonsaayman@gmail.com>
2026-01-30 08:12:04 +02:00
Jay
ee90dfc28a
fix: issues with version 1.13.3 (#7352) 2026-01-27 08:04:06 +02:00
Tackoil
5945e40bb1
fix(interceptor): handle the error in the same interceptor (#6269)
* fix(interceptor): handle the error in the same interceptor

* fix(interceptor): pass the config and data in promise chain

* fix(interceptor): filter out unexpected config and data in promise chain

---------

Co-authored-by: Jay <jasonsaayman@gmail.com>
2026-01-08 21:11:34 +02:00
Ved Vadnere
3141c319c2
chore: remove unnecessary eslint-disable directive (#7283)
Co-authored-by: Jay <jasonsaayman@gmail.com>
2025-12-30 13:11:30 +02:00
Justin Dhillon
d5b76d4af7
style: get rid of redundency in imports (#6315)
Co-authored-by: Jay <jasonsaayman@gmail.com>
2025-11-12 21:11:56 +02:00
Jake Hayes
d6682b2035
chore: add options object to docstring so IDE's indicate it's available (#5999)
Co-authored-by: Jay <jasonsaayman@gmail.com>
2025-11-11 20:51:46 +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
Nikhil Simon Toppo
889f8ef8be
docs: fix mismatched return type (#7172)
Co-authored-by: Jay <jasonsaayman@gmail.com>
2025-10-23 14:39:30 +02:00
Usama Ayoub
9b9ec98548
fix: resolve issue #7131 (added spacing in mergeConfig.js) (#7133)
Co-authored-by: Jay <jasonsaayman@gmail.com>
2025-10-12 16:47:04 +02:00
Noritaka Kobayashi
c26d00f451
refactor: remove redundant assignment (#7029) 2025-09-13 22:10:51 +03: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
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
Noritaka Kobayashi
6161947d9d
refactor: use spread operator instead of '.apply()' (#6938)
Co-authored-by: Jay <jasonsaayman@gmail.com>
2025-07-06 16:59:56 +02:00
Noritaka Kobayashi
a1d16dd9c5
refactor: use an object spread instead of Object.assign (#6939)
Co-authored-by: Jay <jasonsaayman@gmail.com>
2025-07-06 16:51:51 +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
d4f7df4b30
fix(headers): fix getSetCookie by using 'get' method for caseless access; (#6874) 2025-04-14 22:38:27 +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
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
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
Akki
5d99fe4491
fix(core): fixed config merging bug (#6668)
Co-authored-by: rana-aakash <aakash.rana@rooter.io>
Co-authored-by: Dmitriy Mozgovoy <robotshara@gmail.com>
2024-10-30 23:39:55 +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
Kenzo Wada
763895270f
fix: ios11 breaks when build (#6608)
Co-authored-by: Jay <jasonsaayman@gmail.com>
2024-09-26 19:28:35 +02:00
Dmitriy Mozgovoy
6700a8adac
fix(core): add the missed implementation of AxiosError#status property; (#6573) 2024-08-23 15:58:38 +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
Miroslav Petrov
2656612bc1
fix(AxiosHeaders): fix AxiosHeaders conversion to an object during config merging (#6243)
Co-authored-by: Dmitriy Mozgovoy <robotshara@gmail.com>
2024-03-15 18:10:18 +02:00
Dmitriy Mozgovoy
1a08f90f40
fix: capture async stack only for rejections with native error objects; (#6203) 2024-01-25 20:42:38 +02:00
Ilya Priven
123f354b92
fix: wrap errors to improve async stack trace (#5987) 2024-01-25 00:21:12 +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
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
Dmitriy Mozgovoy
e6f7053bf1
perf(merge-config): optimize mergeConfig performance by avoiding duplicate key visits; (#5679) 2023-04-26 00:34:46 +03:00
Dmitriy Mozgovoy
a56c866120
fix(params): re-added the ability to set the function as paramsSerializer config; (#5633) 2023-04-05 19:44:36 +03:00
Dmitriy Mozgovoy
e7decef6a9
fix(headers): fixed isValidHeaderName to support full list of allowed characters; (#5584) 2023-03-19 15:30:51 +02:00
Dmitriy Mozgovoy
ea87ebfe6d
fix(headers): fixed the filtering logic of the clear method; (#5542) 2023-02-11 16:31:03 +02:00
Dmitriy Mozgovoy
96d336f527
fix(formdata): add hotfix to use the asynchronous API to compute the content-length header value; (#5521) 2023-02-02 00:55:05 +02:00
Dmitriy Mozgovoy
9915635c69
fix(headers): fixed & optimized clear method; (#5507) 2023-01-31 00:35:06 +02:00
Dmitriy Mozgovoy
342c0ba9a1
fix(headers): added missed Authorization accessor; (#5502) 2023-01-27 02:01:36 +02:00