2
0
mirror of https://github.com/tenrok/axios.git synced 2026-05-21 13:24:11 +03:00
Commit Graph

133 Commits

Author SHA1 Message Date
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
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
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
Taylor Flatt cc3217a612 fix: updated stream aborted error message to be more clear (#6615) 2024-09-28 13:04:22 +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
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
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
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
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 2701911260 feat(dns): added support for a custom lookup function; (#5339) 2023-04-26 02:04:59 +03:00
Dmitriy Mozgovoy aa372f7306 fix(utils): make isFormData detection logic stricter to avoid unnecessary calling of the toString method on the target; (#5661) 2023-04-19 20:14:32 +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 a3b246c9de fix(http): fixed regression bug when handling synchronous errors inside the adapter; (#5564) 2023-02-22 21:50:31 +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 6ac574e00a feat(fomdata): added support for spec-compliant FormData & Blob types; (#5316) 2023-01-31 01:10:39 +02:00
ItsNotGoodName 65e8d1e28c fix(http): add zlib headers if missing (#5497) 2023-01-31 00:49:37 +02:00
Dmitriy Mozgovoy 9915635c69 fix(headers): fixed & optimized clear method; (#5507) 2023-01-31 00:35:06 +02:00
Dmitriy Mozgovoy 1e58a659ec fix: fixed Brotli decompression; (#5353)
test: added decompression tests;
fix: added legacy `x-gzip` & `x-compress` encoding types;
2022-12-07 20:57:02 +02:00
Dmitriy Mozgovoy 9041c7d272 Fixed decompression for responses without Content-Length header (#5306)
* Fixed decompression for responses without `content-length` header;

* Add Brotli encoding to the `Accept-Encoding` header only if it is supported.

* `content-length` header transformation moved up;

Co-authored-by: Jay <jasonsaayman@gmail.com>
2022-12-01 16:22:20 +02:00
Dmitriy Mozgovoy a3d901777b Fixed Z_BUF_ERROR when content-encoding is set but the response body is empty; (#5250)
Fixed download progress capturing for compressed responses;

Co-authored-by: Jay <jasonsaayman@gmail.com>
2022-11-22 20:49:26 +02:00
Dmitriy Mozgovoy b7ee49f637 Added toJSONObject util; (#5247)
Fixed AxiosError.toJSON method to avoid circular references;

Co-authored-by: Jay <jasonsaayman@gmail.com>
2022-11-22 20:44:24 +02:00
Dmitriy Mozgovoy ab77a40e1c Fixed & Imporoved AxiosHeaders class (#5224)
* Refactored AxiosHeaders class;

* Added support for instances of AxiosHeaders as a value for the headers option;

Co-authored-by: Jay <jasonsaayman@gmail.com>
2022-11-07 21:11:42 +02:00
Patrick Petrovic 717f476b0f fix: restore proxy config backwards compatibility with 0.x (#5097)
* fix: restore proxy config backwards compatibility with 0.x

* Formatting

Co-authored-by: Patrick Petrovic <patrick@Air-de-Patrick.lan>
Co-authored-by: Jay <jasonsaayman@gmail.com>
2022-10-13 21:55:20 +02:00
Dmitriy Mozgovoy 110ae9ae61 fix: handling of array values for AxiosHeaders (#5085)
Co-authored-by: Jay <jasonsaayman@gmail.com>
2022-10-13 21:11:01 +02:00
Dmitriy Mozgovoy 3e4d52171e Fixed query params composing; (#5018)
* Fixes #4999;

* Added regression test;
2022-10-05 21:29:50 +02:00
Luca Pizzini 05338f4454 Removed unused imports (#4949)
Co-authored-by: Jay <jasonsaayman@gmail.com>
2022-09-28 21:16:14 +02:00
felipedamin 738fa63661 Use WHATWG URL API instead of url.parse() (#4852)
* replace url.parse with new whatwg url api

* remove comments

* use const instead of var

Co-authored-by: Jay <jasonsaayman@gmail.com>
2022-09-14 21:40:08 +02:00
Dmitriy Mozgovoy bdf493cf8b Axios ES2017 (#4787)
* Added AxiosHeaders class;

* Fixed README.md href;

* Fixed a potential bug with headers normalization;

* Fixed a potential bug with headers normalization;
Refactored accessor building routine;
Refactored default transforms;
Removed `normalizeHeaderName` helper;

* Added `Content-Length` accessor;
Added missed `has` accessor to TS types;

* Added `AxiosTransformStream` class;
Added progress capturing ability for node.js environment;
Added `maxRate` option to limit the data rate in node.js environment;
Refactored event handled by `onUploadProgress` && `onDownloadProgress` listeners in browser environment;
Added progress & data rate tests for the http adapter;
Added response stream aborting test;
Added a manual progress capture test for the browser;
Updated TS types;
Added TS tests;
Refactored request abort logic for the http adapter;
Added ability to abort the response stream;

* Remove `stream/promises` & `timers/promises` modules usage in tests;

* Use `abortcontroller-polyfill`;

* Fixed AxiosTransformStream dead-lock in legacy node versions;
Fixed CancelError emitting in streams;

* Reworked AxiosTransformStream internal logic to optimize memory consumption;
Added throwing an error if the request stream was silently destroying (without error) Refers to #3966;

* Treat the destruction of the request stream as a cancellation of the request;
Fixed tests;

* Emit `progress` event in the next tick;

* Initial refactoring;

* Refactored Mocha tests to use ESM;

* Refactored Karma tests to use rollup preprocessor & ESM;
Replaced grunt with gulp;
Improved dev scripts;
Added Babel for rollup build;

* Added default commonjs package export for Node build;
Added automatic contributors list generator for package.json;

Co-authored-by: Jay <jasonsaayman@gmail.com>
2022-06-18 11:19:27 +02:00
Jay d82ea47dd3 fix(Tests): updating regex to allow for pre-releases 2022-05-31 21:12:55 +02:00
Victor Augusto a11f9501b8 Fix/4737/timeout error message for http (#4738)
* Fixing timeoutErrorMessage in http calls

When timeoutErrorMessage was set this did not change anything in the error message, with this change the error message will be the configured message

* Testing timeoutErrorMessage in http calls

When timeoutErrorMessage was set this did not change anything in the error message, with this change the error message will be the configured message

Co-authored-by: Jay <jasonsaayman@gmail.com>
2022-05-28 11:46:33 +02:00
Dmitriy Mozgovoy 467025bdb7 Fixed bug #4727 : toFormData Blob issue on node>v17; (#4728)
* Fixed bug #4727;
Added node 18.x to the CI;
Added hotfix for `ERR_OSSL_EVP_UNSUPPORTED` issue with karma running on node >=17.x;
Added `cross-env` to allow running build and test scripts on Windows platforms;

* Added conditional setting of `--openssl-legacy-provider` option for node versions >=17.x;

* Refactored ssl-hotfix & test script;

* Fixed and refactored default max body length test due to ECONNRESET failure;

* Added test for converting the data uri to a Blob;
Fixed bug with parsing mime type for Blob;

Co-authored-by: Jay <jasonsaayman@gmail.com>
2022-05-20 16:31:26 +02:00