diff --git a/CHANGELOG.md b/CHANGELOG.md index 7a0326c6..aa3b2601 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,114 +1,106 @@ -# Changelog - -## [1.13.3](https://github.com/axios/axios/compare/v1.13.2...v1.13.3) (2026-01-20) - - -### Bug Fixes - -* **http2:** Use port 443 for HTTPS connections by default. ([#7256](https://github.com/axios/axios/issues/7256)) ([d7e6065](https://github.com/axios/axios/commit/d7e60653460480ffacecf85383012ca1baa6263e)) -* **interceptor:** handle the error in the same interceptor ([#6269](https://github.com/axios/axios/issues/6269)) ([5945e40](https://github.com/axios/axios/commit/5945e40bb171d4ac4fc195df276cf952244f0f89)) -* main field in package.json should correspond to cjs artifacts ([#5756](https://github.com/axios/axios/issues/5756)) ([7373fbf](https://github.com/axios/axios/commit/7373fbff24cd92ce650d99ff6f7fe08c2e2a0a04)) -* **package.json:** add 'bun' package.json 'exports' condition. Load the Node.js build in Bun instead of the browser build ([#5754](https://github.com/axios/axios/issues/5754)) ([b89217e](https://github.com/axios/axios/commit/b89217e3e91de17a3d55e2b8f39ceb0e9d8aeda8)) -* silentJSONParsing=false should throw on invalid JSON ([#7253](https://github.com/axios/axios/issues/7253)) ([#7257](https://github.com/axios/axios/issues/7257)) ([7d19335](https://github.com/axios/axios/commit/7d19335e43d6754a1a9a66e424f7f7da259895bf)) -* turn AxiosError into a native error ([#5394](https://github.com/axios/axios/issues/5394)) ([#5558](https://github.com/axios/axios/issues/5558)) ([1c6a86d](https://github.com/axios/axios/commit/1c6a86dd2c0623ee1af043a8491dbc96d40e883b)) -* **types:** add handlers to AxiosInterceptorManager interface ([#5551](https://github.com/axios/axios/issues/5551)) ([8d1271b](https://github.com/axios/axios/commit/8d1271b49fc226ed7defd07cd577bd69a55bb13a)) -* **types:** restore AxiosError.cause type from unknown to Error ([#7327](https://github.com/axios/axios/issues/7327)) ([d8233d9](https://github.com/axios/axios/commit/d8233d9e8e9a64bfba9bbe01d475ba417510b82b)) -* unclear error message is thrown when specifying an empty proxy authorization ([#6314](https://github.com/axios/axios/issues/6314)) ([6ef867e](https://github.com/axios/axios/commit/6ef867e684adf7fb2343e3b29a79078a3c76dc29)) - - -### Features - -* add `undefined` as a value in AxiosRequestConfig ([#5560](https://github.com/axios/axios/issues/5560)) ([095033c](https://github.com/axios/axios/commit/095033c626895ecdcda2288050b63dcf948db3bd)) -* add automatic minor and patch upgrades to dependabot ([#6053](https://github.com/axios/axios/issues/6053)) ([65a7584](https://github.com/axios/axios/commit/65a7584eda6164980ddb8cf5372f0afa2a04c1ed)) -* add Node.js coverage script using c8 (closes [#7289](https://github.com/axios/axios/issues/7289)) ([#7294](https://github.com/axios/axios/issues/7294)) ([ec9d94e](https://github.com/axios/axios/commit/ec9d94e9f88da13e9219acadf65061fb38ce080a)) -* added copilot instructions ([3f83143](https://github.com/axios/axios/commit/3f83143bfe617eec17f9d7dcf8bafafeeae74c26)) -* compatibility with frozen prototypes ([#6265](https://github.com/axios/axios/issues/6265)) ([860e033](https://github.com/axios/axios/commit/860e03396a536e9b926dacb6570732489c9d7012)) -* enhance pipeFileToResponse with error handling ([#7169](https://github.com/axios/axios/issues/7169)) ([88d7884](https://github.com/axios/axios/commit/88d78842541610692a04282233933d078a8a2552)) -* **types:** Intellisense for string literals in a widened union ([#6134](https://github.com/axios/axios/issues/6134)) ([f73474d](https://github.com/axios/axios/commit/f73474d02c5aa957b2daeecee65508557fd3c6e5)), closes [/github.com/microsoft/TypeScript/issues/33471#issuecomment-1376364329](https://github.com//github.com/microsoft/TypeScript/issues/33471/issues/issuecomment-1376364329) - - -### Reverts - -* Revert "fix: silentJSONParsing=false should throw on invalid JSON (#7253) (#7…" (#7298) ([a4230f5](https://github.com/axios/axios/commit/a4230f5581b3f58b6ff531b6dbac377a4fd7942a)), closes [#7253](https://github.com/axios/axios/issues/7253) [#7](https://github.com/axios/axios/issues/7) [#7298](https://github.com/axios/axios/issues/7298) -* **deps:** bump peter-evans/create-pull-request from 7 to 8 in the github-actions group ([#7334](https://github.com/axios/axios/issues/7334)) ([2d6ad5e](https://github.com/axios/axios/commit/2d6ad5e48bd29b0b2b5e7e95fb473df98301543a)) - -### Contributors to this release - -- avatar [Ashvin Tiwari](https://github.com/ashvin2005 "+1752/-4 (#7218 #7218 )") -- avatar [Nikunj Mochi](https://github.com/mochinikunj "+940/-12 (#7294 #7294 )") -- avatar [Anchal Singh](https://github.com/imanchalsingh "+544/-102 (#7169 #7185 )") -- avatar [jasonsaayman](https://github.com/jasonsaayman "+317/-73 (#7334 #7298 )") -- avatar [Julian Dax](https://github.com/brodo "+99/-120 (#5558 )") -- avatar [Akash Dhar Dubey](https://github.com/AKASHDHARDUBEY "+167/-0 (#7287 #7288 )") -- avatar [Madhumita](https://github.com/madhumitaaa "+20/-68 (#7198 )") -- avatar [Tackoil](https://github.com/Tackoil "+80/-2 (#6269 )") -- avatar [Justin Dhillon](https://github.com/justindhillon "+41/-41 (#6324 #6315 )") -- avatar [Rudransh](https://github.com/Rudrxxx "+71/-2 (#7257 )") -- avatar [WuMingDao](https://github.com/WuMingDao "+36/-36 (#7215 )") -- avatar [codenomnom](https://github.com/codenomnom "+70/-0 (#7201 #7201 )") -- avatar [Nandan Acharya](https://github.com/Nandann018-ux "+60/-10 (#7272 )") -- avatar [Eric Dubé](https://github.com/KernelDeimos "+22/-40 (#7042 )") -- avatar [Tibor Pilz](https://github.com/tiborpilz "+40/-4 (#5551 )") -- avatar [Gabriel Quaresma](https://github.com/joaoGabriel55 "+31/-4 (#6314 )") -- avatar [Turadg Aleahmad](https://github.com/turadg "+23/-6 (#6265 )") -- avatar [JohnTitor](https://github.com/kiritosan "+14/-14 (#6155 )") -- avatar [rohit miryala](https://github.com/rohitmiryala "+22/-0 (#7250 )") -- avatar [Wilson Mun](https://github.com/wmundev "+20/-0 (#6053 )") -- avatar [techcodie](https://github.com/techcodie "+7/-7 (#7236 )") -- avatar [Ved Vadnere](https://github.com/Archis009 "+5/-6 (#7283 )") -- avatar [svihpinc](https://github.com/svihpinc "+5/-3 (#6134 )") -- avatar [SANDESH LENDVE](https://github.com/mrsandy1965 "+3/-3 (#7246 )") -- avatar [Lubos](https://github.com/mrlubos "+5/-1 (#7312 )") -- avatar [Jarred Sumner](https://github.com/Jarred-Sumner "+5/-1 (#5754 )") -- avatar [Adam Hines](https://github.com/thebanjomatic "+2/-1 (#5756 )") -- avatar [Subhan Kumar Rai](https://github.com/Subhan030 "+2/-1 (#7256 )") -- avatar [Joseph Frazier](https://github.com/josephfrazier "+1/-1 (#7311 )") -- avatar [KT0803](https://github.com/KT0803 "+0/-2 (#7229 )") -- avatar [Albie](https://github.com/AlbertoSadoc "+1/-1 (#5560 )") -- avatar [Jake Hayes](https://github.com/thejayhaykid "+1/-0 (#5999 )") - -## [1.13.2](https://github.com/axios/axios/compare/v1.13.1...v1.13.2) (2025-11-04) - - -### Bug Fixes - -* **http:** fix 'socket hang up' bug for keep-alive requests when using timeouts; ([#7206](https://github.com/axios/axios/issues/7206)) ([8d37233](https://github.com/axios/axios/commit/8d372335f5c50ecd01e8615f2468a9eb19703117)) -* **http:** use default export for http2 module to support stubs; ([#7196](https://github.com/axios/axios/issues/7196)) ([0588880](https://github.com/axios/axios/commit/0588880ac7ddba7594ef179930493884b7e90bf5)) - - -### Performance Improvements - -* **http:** fix early loop exit; ([#7202](https://github.com/axios/axios/issues/7202)) ([12c314b](https://github.com/axios/axios/commit/12c314b603e7852a157e93e47edb626a471ba6c5)) - -### Contributors to this release - -- avatar [Dmitriy Mozgovoy](https://github.com/DigitalBrainJS "+28/-9 (#7206 #7202 )") -- avatar [Kasper Isager Dalsgarð](https://github.com/kasperisager "+9/-9 (#7196 )") - -## [1.13.1](https://github.com/axios/axios/compare/v1.13.0...v1.13.1) (2025-10-28) - - -### Bug Fixes - -* **http:** fixed a regression that caused the data stream to be interrupted for responses with non-OK HTTP statuses; ([#7193](https://github.com/axios/axios/issues/7193)) ([bcd5581](https://github.com/axios/axios/commit/bcd5581d208cd372055afdcb2fd10b68ca40613c)) - -### Contributors to this release - -- avatar [Anchal Singh](https://github.com/imanchalsingh "+220/-111 (#7173 )") -- avatar [Dmitriy Mozgovoy](https://github.com/DigitalBrainJS "+18/-1 (#7193 )") - -# [1.13.0](https://github.com/axios/axios/compare/v1.12.2...v1.13.0) (2025-10-27) +# Changelog +## [1.13.3](https://github.com/axios/axios/compare/v1.13.2...v1.13.3) (2026-01-20) ### Bug Fixes -* **fetch:** prevent TypeError when config.env is undefined ([#7155](https://github.com/axios/axios/issues/7155)) ([015faec](https://github.com/axios/axios/commit/015faeca9f26db76f9562760f04bb9f8229f4db1)) -* resolve issue [#7131](https://github.com/axios/axios/issues/7131) (added spacing in mergeConfig.js) ([#7133](https://github.com/axios/axios/issues/7133)) ([9b9ec98](https://github.com/axios/axios/commit/9b9ec98548d93e9f2204deea10a5f1528bf3ce62)) - +- **http2:** Use port 443 for HTTPS connections by default. ([#7256](https://github.com/axios/axios/issues/7256)) ([d7e6065](https://github.com/axios/axios/commit/d7e60653460480ffacecf85383012ca1baa6263e)) +- **interceptor:** handle the error in the same interceptor ([#6269](https://github.com/axios/axios/issues/6269)) ([5945e40](https://github.com/axios/axios/commit/5945e40bb171d4ac4fc195df276cf952244f0f89)) +- main field in package.json should correspond to cjs artifacts ([#5756](https://github.com/axios/axios/issues/5756)) ([7373fbf](https://github.com/axios/axios/commit/7373fbff24cd92ce650d99ff6f7fe08c2e2a0a04)) +- **package.json:** add 'bun' package.json 'exports' condition. Load the Node.js build in Bun instead of the browser build ([#5754](https://github.com/axios/axios/issues/5754)) ([b89217e](https://github.com/axios/axios/commit/b89217e3e91de17a3d55e2b8f39ceb0e9d8aeda8)) +- silentJSONParsing=false should throw on invalid JSON ([#7253](https://github.com/axios/axios/issues/7253)) ([#7257](https://github.com/axios/axios/issues/7257)) ([7d19335](https://github.com/axios/axios/commit/7d19335e43d6754a1a9a66e424f7f7da259895bf)) +- turn AxiosError into a native error ([#5394](https://github.com/axios/axios/issues/5394)) ([#5558](https://github.com/axios/axios/issues/5558)) ([1c6a86d](https://github.com/axios/axios/commit/1c6a86dd2c0623ee1af043a8491dbc96d40e883b)) +- **types:** add handlers to AxiosInterceptorManager interface ([#5551](https://github.com/axios/axios/issues/5551)) ([8d1271b](https://github.com/axios/axios/commit/8d1271b49fc226ed7defd07cd577bd69a55bb13a)) +- **types:** restore AxiosError.cause type from unknown to Error ([#7327](https://github.com/axios/axios/issues/7327)) ([d8233d9](https://github.com/axios/axios/commit/d8233d9e8e9a64bfba9bbe01d475ba417510b82b)) +- unclear error message is thrown when specifying an empty proxy authorization ([#6314](https://github.com/axios/axios/issues/6314)) ([6ef867e](https://github.com/axios/axios/commit/6ef867e684adf7fb2343e3b29a79078a3c76dc29)) ### Features -* **http:** add HTTP2 support; ([#7150](https://github.com/axios/axios/issues/7150)) ([d676df7](https://github.com/axios/axios/commit/d676df772244726533ca320f42e967f5af056bac)) +- add `undefined` as a value in AxiosRequestConfig ([#5560](https://github.com/axios/axios/issues/5560)) ([095033c](https://github.com/axios/axios/commit/095033c626895ecdcda2288050b63dcf948db3bd)) +- add automatic minor and patch upgrades to dependabot ([#6053](https://github.com/axios/axios/issues/6053)) ([65a7584](https://github.com/axios/axios/commit/65a7584eda6164980ddb8cf5372f0afa2a04c1ed)) +- add Node.js coverage script using c8 (closes [#7289](https://github.com/axios/axios/issues/7289)) ([#7294](https://github.com/axios/axios/issues/7294)) ([ec9d94e](https://github.com/axios/axios/commit/ec9d94e9f88da13e9219acadf65061fb38ce080a)) +- added copilot instructions ([3f83143](https://github.com/axios/axios/commit/3f83143bfe617eec17f9d7dcf8bafafeeae74c26)) +- compatibility with frozen prototypes ([#6265](https://github.com/axios/axios/issues/6265)) ([860e033](https://github.com/axios/axios/commit/860e03396a536e9b926dacb6570732489c9d7012)) +- enhance pipeFileToResponse with error handling ([#7169](https://github.com/axios/axios/issues/7169)) ([88d7884](https://github.com/axios/axios/commit/88d78842541610692a04282233933d078a8a2552)) +- **types:** Intellisense for string literals in a widened union ([#6134](https://github.com/axios/axios/issues/6134)) ([f73474d](https://github.com/axios/axios/commit/f73474d02c5aa957b2daeecee65508557fd3c6e5)), closes [/github.com/microsoft/TypeScript/issues/33471#issuecomment-1376364329](https://github.com//github.com/microsoft/TypeScript/issues/33471/issues/issuecomment-1376364329) + +### Reverts + +- Revert "fix: silentJSONParsing=false should throw on invalid JSON (#7253) (#7…" (#7298) ([a4230f5](https://github.com/axios/axios/commit/a4230f5581b3f58b6ff531b6dbac377a4fd7942a)), closes [#7253](https://github.com/axios/axios/issues/7253) [#7](https://github.com/axios/axios/issues/7) [#7298](https://github.com/axios/axios/issues/7298) +- **deps:** bump peter-evans/create-pull-request from 7 to 8 in the github-actions group ([#7334](https://github.com/axios/axios/issues/7334)) ([2d6ad5e](https://github.com/axios/axios/commit/2d6ad5e48bd29b0b2b5e7e95fb473df98301543a)) + +### Contributors to this release + +- avatar [Ashvin Tiwari](https://github.com/ashvin2005 "+1752/-4 (#7218 #7218 )") +- avatar [Nikunj Mochi](https://github.com/mochinikunj "+940/-12 (#7294 #7294 )") +- avatar [Anchal Singh](https://github.com/imanchalsingh "+544/-102 (#7169 #7185 )") +- avatar [jasonsaayman](https://github.com/jasonsaayman "+317/-73 (#7334 #7298 )") +- avatar [Julian Dax](https://github.com/brodo "+99/-120 (#5558 )") +- avatar [Akash Dhar Dubey](https://github.com/AKASHDHARDUBEY "+167/-0 (#7287 #7288 )") +- avatar [Madhumita](https://github.com/madhumitaaa "+20/-68 (#7198 )") +- avatar [Tackoil](https://github.com/Tackoil "+80/-2 (#6269 )") +- avatar [Justin Dhillon](https://github.com/justindhillon "+41/-41 (#6324 #6315 )") +- avatar [Rudransh](https://github.com/Rudrxxx "+71/-2 (#7257 )") +- avatar [WuMingDao](https://github.com/WuMingDao "+36/-36 (#7215 )") +- avatar [codenomnom](https://github.com/codenomnom "+70/-0 (#7201 #7201 )") +- avatar [Nandan Acharya](https://github.com/Nandann018-ux "+60/-10 (#7272 )") +- avatar [Eric Dubé](https://github.com/KernelDeimos "+22/-40 (#7042 )") +- avatar [Tibor Pilz](https://github.com/tiborpilz "+40/-4 (#5551 )") +- avatar [Gabriel Quaresma](https://github.com/joaoGabriel55 "+31/-4 (#6314 )") +- avatar [Turadg Aleahmad](https://github.com/turadg "+23/-6 (#6265 )") +- avatar [JohnTitor](https://github.com/kiritosan "+14/-14 (#6155 )") +- avatar [rohit miryala](https://github.com/rohitmiryala "+22/-0 (#7250 )") +- avatar [Wilson Mun](https://github.com/wmundev "+20/-0 (#6053 )") +- avatar [techcodie](https://github.com/techcodie "+7/-7 (#7236 )") +- avatar [Ved Vadnere](https://github.com/Archis009 "+5/-6 (#7283 )") +- avatar [svihpinc](https://github.com/svihpinc "+5/-3 (#6134 )") +- avatar [SANDESH LENDVE](https://github.com/mrsandy1965 "+3/-3 (#7246 )") +- avatar [Lubos](https://github.com/mrlubos "+5/-1 (#7312 )") +- avatar [Jarred Sumner](https://github.com/Jarred-Sumner "+5/-1 (#5754 )") +- avatar [Adam Hines](https://github.com/thebanjomatic "+2/-1 (#5756 )") +- avatar [Subhan Kumar Rai](https://github.com/Subhan030 "+2/-1 (#7256 )") +- avatar [Joseph Frazier](https://github.com/josephfrazier "+1/-1 (#7311 )") +- avatar [KT0803](https://github.com/KT0803 "+0/-2 (#7229 )") +- avatar [Albie](https://github.com/AlbertoSadoc "+1/-1 (#5560 )") +- avatar [Jake Hayes](https://github.com/thejayhaykid "+1/-0 (#5999 )") + +## [1.13.2](https://github.com/axios/axios/compare/v1.13.1...v1.13.2) (2025-11-04) + +### Bug Fixes + +- **http:** fix 'socket hang up' bug for keep-alive requests when using timeouts; ([#7206](https://github.com/axios/axios/issues/7206)) ([8d37233](https://github.com/axios/axios/commit/8d372335f5c50ecd01e8615f2468a9eb19703117)) +- **http:** use default export for http2 module to support stubs; ([#7196](https://github.com/axios/axios/issues/7196)) ([0588880](https://github.com/axios/axios/commit/0588880ac7ddba7594ef179930493884b7e90bf5)) + +### Performance Improvements + +- **http:** fix early loop exit; ([#7202](https://github.com/axios/axios/issues/7202)) ([12c314b](https://github.com/axios/axios/commit/12c314b603e7852a157e93e47edb626a471ba6c5)) + +### Contributors to this release + +- avatar [Dmitriy Mozgovoy](https://github.com/DigitalBrainJS "+28/-9 (#7206 #7202 )") +- avatar [Kasper Isager Dalsgarð](https://github.com/kasperisager "+9/-9 (#7196 )") + +## [1.13.1](https://github.com/axios/axios/compare/v1.13.0...v1.13.1) (2025-10-28) + +### Bug Fixes + +- **http:** fixed a regression that caused the data stream to be interrupted for responses with non-OK HTTP statuses; ([#7193](https://github.com/axios/axios/issues/7193)) ([bcd5581](https://github.com/axios/axios/commit/bcd5581d208cd372055afdcb2fd10b68ca40613c)) + +### Contributors to this release + +- avatar [Anchal Singh](https://github.com/imanchalsingh "+220/-111 (#7173 )") +- avatar [Dmitriy Mozgovoy](https://github.com/DigitalBrainJS "+18/-1 (#7193 )") + +# [1.13.0](https://github.com/axios/axios/compare/v1.12.2...v1.13.0) (2025-10-27) + +### Bug Fixes + +- **fetch:** prevent TypeError when config.env is undefined ([#7155](https://github.com/axios/axios/issues/7155)) ([015faec](https://github.com/axios/axios/commit/015faeca9f26db76f9562760f04bb9f8229f4db1)) +- resolve issue [#7131](https://github.com/axios/axios/issues/7131) (added spacing in mergeConfig.js) ([#7133](https://github.com/axios/axios/issues/7133)) ([9b9ec98](https://github.com/axios/axios/commit/9b9ec98548d93e9f2204deea10a5f1528bf3ce62)) + +### Features + +- **http:** add HTTP2 support; ([#7150](https://github.com/axios/axios/issues/7150)) ([d676df7](https://github.com/axios/axios/commit/d676df772244726533ca320f42e967f5af056bac)) ### Contributors to this release @@ -132,10 +124,9 @@ ## [1.12.2](https://github.com/axios/axios/compare/v1.12.1...v1.12.2) (2025-09-14) - ### Bug Fixes -* **fetch:** use current global fetch instead of cached one when env fetch is not specified to keep MSW support; ([#7030](https://github.com/axios/axios/issues/7030)) ([cf78825](https://github.com/axios/axios/commit/cf78825e1229b60d1629ad0bbc8a752ff43c3f53)) +- **fetch:** use current global fetch instead of cached one when env fetch is not specified to keep MSW support; ([#7030](https://github.com/axios/axios/issues/7030)) ([cf78825](https://github.com/axios/axios/commit/cf78825e1229b60d1629ad0bbc8a752ff43c3f53)) ### Contributors to this release @@ -144,10 +135,9 @@ ## [1.12.1](https://github.com/axios/axios/compare/v1.12.0...v1.12.1) (2025-09-12) - ### Bug Fixes -* **types:** fixed env config types; ([#7020](https://github.com/axios/axios/issues/7020)) ([b5f26b7](https://github.com/axios/axios/commit/b5f26b75bdd9afa95016fb67d0cab15fc74cbf05)) +- **types:** fixed env config types; ([#7020](https://github.com/axios/axios/issues/7020)) ([b5f26b7](https://github.com/axios/axios/commit/b5f26b75bdd9afa95016fb67d0cab15fc74cbf05)) ### Contributors to this release @@ -155,25 +145,23 @@ # [1.12.0](https://github.com/axios/axios/compare/v1.11.0...v1.12.0) (2025-09-11) - ### Bug Fixes -* adding build artifacts ([9ec86de](https://github.com/axios/axios/commit/9ec86de257bfa33856571036279169f385ed92bd)) -* dont add dist on release ([a2edc36](https://github.com/axios/axios/commit/a2edc3606a4f775d868a67bb3461ff18ce7ecd11)) -* **fetch-adapter:** set correct Content-Type for Node FormData ([#6998](https://github.com/axios/axios/issues/6998)) ([a9f47af](https://github.com/axios/axios/commit/a9f47afbf3224d2ca987dbd8188789c7ea853c5d)) -* **node:** enforce maxContentLength for data: URLs ([#7011](https://github.com/axios/axios/issues/7011)) ([945435f](https://github.com/axios/axios/commit/945435fc51467303768202250debb8d4ae892593)) -* package exports ([#5627](https://github.com/axios/axios/issues/5627)) ([aa78ac2](https://github.com/axios/axios/commit/aa78ac23fc9036163308c0f6bd2bb885e7af3f36)) -* **params:** removing '[' and ']' from URL encode exclude characters ([#3316](https://github.com/axios/axios/issues/3316)) ([#5715](https://github.com/axios/axios/issues/5715)) ([6d84189](https://github.com/axios/axios/commit/6d84189349c43b1dcdd977b522610660cc4c7042)) -* release pr run ([fd7f404](https://github.com/axios/axios/commit/fd7f404488b2c4f238c2fbe635b58026a634bfd2)) -* **types:** change the type guard on isCancel ([#5595](https://github.com/axios/axios/issues/5595)) ([0dbb7fd](https://github.com/axios/axios/commit/0dbb7fd4f61dc568498cd13a681fa7f907d6ec7e)) - +- adding build artifacts ([9ec86de](https://github.com/axios/axios/commit/9ec86de257bfa33856571036279169f385ed92bd)) +- dont add dist on release ([a2edc36](https://github.com/axios/axios/commit/a2edc3606a4f775d868a67bb3461ff18ce7ecd11)) +- **fetch-adapter:** set correct Content-Type for Node FormData ([#6998](https://github.com/axios/axios/issues/6998)) ([a9f47af](https://github.com/axios/axios/commit/a9f47afbf3224d2ca987dbd8188789c7ea853c5d)) +- **node:** enforce maxContentLength for data: URLs ([#7011](https://github.com/axios/axios/issues/7011)) ([945435f](https://github.com/axios/axios/commit/945435fc51467303768202250debb8d4ae892593)) +- package exports ([#5627](https://github.com/axios/axios/issues/5627)) ([aa78ac2](https://github.com/axios/axios/commit/aa78ac23fc9036163308c0f6bd2bb885e7af3f36)) +- **params:** removing '[' and ']' from URL encode exclude characters ([#3316](https://github.com/axios/axios/issues/3316)) ([#5715](https://github.com/axios/axios/issues/5715)) ([6d84189](https://github.com/axios/axios/commit/6d84189349c43b1dcdd977b522610660cc4c7042)) +- release pr run ([fd7f404](https://github.com/axios/axios/commit/fd7f404488b2c4f238c2fbe635b58026a634bfd2)) +- **types:** change the type guard on isCancel ([#5595](https://github.com/axios/axios/issues/5595)) ([0dbb7fd](https://github.com/axios/axios/commit/0dbb7fd4f61dc568498cd13a681fa7f907d6ec7e)) ### Features -* **adapter:** surface low‑level network error details; attach original error via cause ([#6982](https://github.com/axios/axios/issues/6982)) ([78b290c](https://github.com/axios/axios/commit/78b290c57c978ed2ab420b90d97350231c9e5d74)) -* **fetch:** add fetch, Request, Response env config variables for the adapter; ([#7003](https://github.com/axios/axios/issues/7003)) ([c959ff2](https://github.com/axios/axios/commit/c959ff29013a3bc90cde3ac7ea2d9a3f9c08974b)) -* support reviver on JSON.parse ([#5926](https://github.com/axios/axios/issues/5926)) ([2a97634](https://github.com/axios/axios/commit/2a9763426e43d996fd60d01afe63fa6e1f5b4fca)), closes [#5924](https://github.com/axios/axios/issues/5924) -* **types:** extend AxiosResponse interface to include custom headers type ([#6782](https://github.com/axios/axios/issues/6782)) ([7960d34](https://github.com/axios/axios/commit/7960d34eded2de66ffd30b4687f8da0e46c4903e)) +- **adapter:** surface low‑level network error details; attach original error via cause ([#6982](https://github.com/axios/axios/issues/6982)) ([78b290c](https://github.com/axios/axios/commit/78b290c57c978ed2ab420b90d97350231c9e5d74)) +- **fetch:** add fetch, Request, Response env config variables for the adapter; ([#7003](https://github.com/axios/axios/issues/7003)) ([c959ff2](https://github.com/axios/axios/commit/c959ff29013a3bc90cde3ac7ea2d9a3f9c08974b)) +- support reviver on JSON.parse ([#5926](https://github.com/axios/axios/issues/5926)) ([2a97634](https://github.com/axios/axios/commit/2a9763426e43d996fd60d01afe63fa6e1f5b4fca)), closes [#5924](https://github.com/axios/axios/issues/5924) +- **types:** extend AxiosResponse interface to include custom headers type ([#6782](https://github.com/axios/axios/issues/6782)) ([7960d34](https://github.com/axios/axios/commit/7960d34eded2de66ffd30b4687f8da0e46c4903e)) ### Contributors to this release @@ -190,12 +178,11 @@ # [1.11.0](https://github.com/axios/axios/compare/v1.10.0...v1.11.0) (2025-07-22) - ### Bug Fixes -* form-data npm pakcage ([#6970](https://github.com/axios/axios/issues/6970)) ([e72c193](https://github.com/axios/axios/commit/e72c193722530db538b19e5ddaaa4544d226b253)) -* prevent RangeError when using large Buffers ([#6961](https://github.com/axios/axios/issues/6961)) ([a2214ca](https://github.com/axios/axios/commit/a2214ca1bc60540baf2c80573cea3a0ff91ba9d1)) -* **types:** resolve type discrepancies between ESM and CJS TypeScript declaration files ([#6956](https://github.com/axios/axios/issues/6956)) ([8517aa1](https://github.com/axios/axios/commit/8517aa16f8d082fc1d5309c642220fa736159110)) +- form-data npm pakcage ([#6970](https://github.com/axios/axios/issues/6970)) ([e72c193](https://github.com/axios/axios/commit/e72c193722530db538b19e5ddaaa4544d226b253)) +- prevent RangeError when using large Buffers ([#6961](https://github.com/axios/axios/issues/6961)) ([a2214ca](https://github.com/axios/axios/commit/a2214ca1bc60540baf2c80573cea3a0ff91ba9d1)) +- **types:** resolve type discrepancies between ESM and CJS TypeScript declaration files ([#6956](https://github.com/axios/axios/issues/6956)) ([8517aa1](https://github.com/axios/axios/commit/8517aa16f8d082fc1d5309c642220fa736159110)) ### Contributors to this release @@ -207,17 +194,15 @@ # [1.10.0](https://github.com/axios/axios/compare/v1.9.0...v1.10.0) (2025-06-14) - ### Bug Fixes -* **adapter:** pass fetchOptions to fetch function ([#6883](https://github.com/axios/axios/issues/6883)) ([0f50af8](https://github.com/axios/axios/commit/0f50af8e076b7fb403844789bd5e812dedcaf4ed)) -* **form-data:** convert boolean values to strings in FormData serialization ([#6917](https://github.com/axios/axios/issues/6917)) ([5064b10](https://github.com/axios/axios/commit/5064b108de336ff34862650709761b8a96d26be0)) -* **package:** add module entry point for React Native; ([#6933](https://github.com/axios/axios/issues/6933)) ([3d343b8](https://github.com/axios/axios/commit/3d343b86dc4fd0eea0987059c5af04327c7ae304)) - +- **adapter:** pass fetchOptions to fetch function ([#6883](https://github.com/axios/axios/issues/6883)) ([0f50af8](https://github.com/axios/axios/commit/0f50af8e076b7fb403844789bd5e812dedcaf4ed)) +- **form-data:** convert boolean values to strings in FormData serialization ([#6917](https://github.com/axios/axios/issues/6917)) ([5064b10](https://github.com/axios/axios/commit/5064b108de336ff34862650709761b8a96d26be0)) +- **package:** add module entry point for React Native; ([#6933](https://github.com/axios/axios/issues/6933)) ([3d343b8](https://github.com/axios/axios/commit/3d343b86dc4fd0eea0987059c5af04327c7ae304)) ### Features -* **types:** improved fetchOptions interface ([#6867](https://github.com/axios/axios/issues/6867)) ([63f1fce](https://github.com/axios/axios/commit/63f1fce233009f5db1abf2586c145825ac98c3d7)) +- **types:** improved fetchOptions interface ([#6867](https://github.com/axios/axios/issues/6867)) ([63f1fce](https://github.com/axios/axios/commit/63f1fce233009f5db1abf2586c145825ac98c3d7)) ### Contributors to this release @@ -231,21 +216,19 @@ # [1.9.0](https://github.com/axios/axios/compare/v1.8.4...v1.9.0) (2025-04-24) - ### Bug Fixes -* **core:** fix the Axios constructor implementation to treat the config argument as optional; ([#6881](https://github.com/axios/axios/issues/6881)) ([6c5d4cd](https://github.com/axios/axios/commit/6c5d4cd69286868059c5e52d45085cb9a894a983)) -* **fetch:** fixed ERR_NETWORK mapping for Safari browsers; ([#6767](https://github.com/axios/axios/issues/6767)) ([dfe8411](https://github.com/axios/axios/commit/dfe8411c9a082c3d068bdd1f8d6e73054f387f45)) -* **headers:** allow iterable objects to be a data source for the set method; ([#6873](https://github.com/axios/axios/issues/6873)) ([1b1f9cc](https://github.com/axios/axios/commit/1b1f9ccdc15f1ea745160ec9a5223de9db4673bc)) -* **headers:** fix `getSetCookie` by using 'get' method for caseless access; ([#6874](https://github.com/axios/axios/issues/6874)) ([d4f7df4](https://github.com/axios/axios/commit/d4f7df4b304af8b373488fdf8e830793ff843eb9)) -* **headers:** fixed support for setting multiple header values from an iterated source; ([#6885](https://github.com/axios/axios/issues/6885)) ([f7a3b5e](https://github.com/axios/axios/commit/f7a3b5e0f7e5e127b97defa92a132fbf1b55cf15)) -* **http:** send minimal end multipart boundary ([#6661](https://github.com/axios/axios/issues/6661)) ([987d2e2](https://github.com/axios/axios/commit/987d2e2dd3b362757550f36eab875e60640b6ddc)) -* **types:** fix autocomplete for adapter config ([#6855](https://github.com/axios/axios/issues/6855)) ([e61a893](https://github.com/axios/axios/commit/e61a8934d8f94dd429a2f309b48c67307c700df0)) - +- **core:** fix the Axios constructor implementation to treat the config argument as optional; ([#6881](https://github.com/axios/axios/issues/6881)) ([6c5d4cd](https://github.com/axios/axios/commit/6c5d4cd69286868059c5e52d45085cb9a894a983)) +- **fetch:** fixed ERR_NETWORK mapping for Safari browsers; ([#6767](https://github.com/axios/axios/issues/6767)) ([dfe8411](https://github.com/axios/axios/commit/dfe8411c9a082c3d068bdd1f8d6e73054f387f45)) +- **headers:** allow iterable objects to be a data source for the set method; ([#6873](https://github.com/axios/axios/issues/6873)) ([1b1f9cc](https://github.com/axios/axios/commit/1b1f9ccdc15f1ea745160ec9a5223de9db4673bc)) +- **headers:** fix `getSetCookie` by using 'get' method for caseless access; ([#6874](https://github.com/axios/axios/issues/6874)) ([d4f7df4](https://github.com/axios/axios/commit/d4f7df4b304af8b373488fdf8e830793ff843eb9)) +- **headers:** fixed support for setting multiple header values from an iterated source; ([#6885](https://github.com/axios/axios/issues/6885)) ([f7a3b5e](https://github.com/axios/axios/commit/f7a3b5e0f7e5e127b97defa92a132fbf1b55cf15)) +- **http:** send minimal end multipart boundary ([#6661](https://github.com/axios/axios/issues/6661)) ([987d2e2](https://github.com/axios/axios/commit/987d2e2dd3b362757550f36eab875e60640b6ddc)) +- **types:** fix autocomplete for adapter config ([#6855](https://github.com/axios/axios/issues/6855)) ([e61a893](https://github.com/axios/axios/commit/e61a8934d8f94dd429a2f309b48c67307c700df0)) ### Features -* **AxiosHeaders:** add getSetCookie method to retrieve set-cookie headers values ([#5707](https://github.com/axios/axios/issues/5707)) ([80ea756](https://github.com/axios/axios/commit/80ea756e72bcf53110fa792f5d7ab76e8b11c996)) +- **AxiosHeaders:** add getSetCookie method to retrieve set-cookie headers values ([#5707](https://github.com/axios/axios/issues/5707)) ([80ea756](https://github.com/axios/axios/commit/80ea756e72bcf53110fa792f5d7ab76e8b11c996)) ### Contributors to this release @@ -258,10 +241,9 @@ ## [1.8.4](https://github.com/axios/axios/compare/v1.8.3...v1.8.4) (2025-03-19) - ### Bug Fixes -* **buildFullPath:** handle `allowAbsoluteUrls: false` without `baseURL` ([#6833](https://github.com/axios/axios/issues/6833)) ([f10c2e0](https://github.com/axios/axios/commit/f10c2e0de7fde0051f848609a29c2906d0caa1d9)) +- **buildFullPath:** handle `allowAbsoluteUrls: false` without `baseURL` ([#6833](https://github.com/axios/axios/issues/6833)) ([f10c2e0](https://github.com/axios/axios/commit/f10c2e0de7fde0051f848609a29c2906d0caa1d9)) ### Contributors to this release @@ -269,11 +251,10 @@ ## [1.8.3](https://github.com/axios/axios/compare/v1.8.2...v1.8.3) (2025-03-10) - ### Bug Fixes -* add missing type for allowAbsoluteUrls ([#6818](https://github.com/axios/axios/issues/6818)) ([10fa70e](https://github.com/axios/axios/commit/10fa70ef14fe39558b15a179f0e82f5f5e5d11b2)) -* **xhr/fetch:** pass `allowAbsoluteUrls` to `buildFullPath` in `xhr` and `fetch` adapters ([#6814](https://github.com/axios/axios/issues/6814)) ([ec159e5](https://github.com/axios/axios/commit/ec159e507bdf08c04ba1a10fe7710094e9e50ec9)) +- add missing type for allowAbsoluteUrls ([#6818](https://github.com/axios/axios/issues/6818)) ([10fa70e](https://github.com/axios/axios/commit/10fa70ef14fe39558b15a179f0e82f5f5e5d11b2)) +- **xhr/fetch:** pass `allowAbsoluteUrls` to `buildFullPath` in `xhr` and `fetch` adapters ([#6814](https://github.com/axios/axios/issues/6814)) ([ec159e5](https://github.com/axios/axios/commit/ec159e507bdf08c04ba1a10fe7710094e9e50ec9)) ### Contributors to this release @@ -283,10 +264,9 @@ ## [1.8.2](https://github.com/axios/axios/compare/v1.8.1...v1.8.2) (2025-03-07) - ### Bug Fixes -* **http-adapter:** add allowAbsoluteUrls to path building ([#6810](https://github.com/axios/axios/issues/6810)) ([fb8eec2](https://github.com/axios/axios/commit/fb8eec214ce7744b5ca787f2c3b8339b2f54b00f)) +- **http-adapter:** add allowAbsoluteUrls to path building ([#6810](https://github.com/axios/axios/issues/6810)) ([fb8eec2](https://github.com/axios/axios/commit/fb8eec214ce7744b5ca787f2c3b8339b2f54b00f)) ### Contributors to this release @@ -294,10 +274,9 @@ ## [1.8.1](https://github.com/axios/axios/compare/v1.8.0...v1.8.1) (2025-02-26) - ### Bug Fixes -* **utils:** move `generateString` to platform utils to avoid importing crypto module into client builds; ([#6789](https://github.com/axios/axios/issues/6789)) ([36a5a62](https://github.com/axios/axios/commit/36a5a620bec0b181451927f13ac85b9888b86cec)) +- **utils:** move `generateString` to platform utils to avoid importing crypto module into client builds; ([#6789](https://github.com/axios/axios/issues/6789)) ([36a5a62](https://github.com/axios/axios/commit/36a5a620bec0b181451927f13ac85b9888b86cec)) ### Contributors to this release @@ -305,33 +284,29 @@ # [1.8.0](https://github.com/axios/axios/compare/v1.7.9...v1.8.0) (2025-02-25) - ### Bug Fixes -* **examples:** application crashed when navigating examples in browser ([#5938](https://github.com/axios/axios/issues/5938)) ([1260ded](https://github.com/axios/axios/commit/1260ded634ec101dd5ed05d3b70f8e8f899dba6c)) -* missing word in SUPPORT_QUESTION.yml ([#6757](https://github.com/axios/axios/issues/6757)) ([1f890b1](https://github.com/axios/axios/commit/1f890b13f2c25a016f3c84ae78efb769f244133e)) -* **utils:** replace getRandomValues with crypto module ([#6788](https://github.com/axios/axios/issues/6788)) ([23a25af](https://github.com/axios/axios/commit/23a25af0688d1db2c396deb09229d2271cc24f6c)) - +- **examples:** application crashed when navigating examples in browser ([#5938](https://github.com/axios/axios/issues/5938)) ([1260ded](https://github.com/axios/axios/commit/1260ded634ec101dd5ed05d3b70f8e8f899dba6c)) +- missing word in SUPPORT_QUESTION.yml ([#6757](https://github.com/axios/axios/issues/6757)) ([1f890b1](https://github.com/axios/axios/commit/1f890b13f2c25a016f3c84ae78efb769f244133e)) +- **utils:** replace getRandomValues with crypto module ([#6788](https://github.com/axios/axios/issues/6788)) ([23a25af](https://github.com/axios/axios/commit/23a25af0688d1db2c396deb09229d2271cc24f6c)) ### Features -* Add config for ignoring absolute URLs ([#5902](https://github.com/axios/axios/issues/5902)) ([#6192](https://github.com/axios/axios/issues/6192)) ([32c7bcc](https://github.com/axios/axios/commit/32c7bcc0f233285ba27dec73a4b1e81fb7a219b3)) - +- Add config for ignoring absolute URLs ([#5902](https://github.com/axios/axios/issues/5902)) ([#6192](https://github.com/axios/axios/issues/6192)) ([32c7bcc](https://github.com/axios/axios/commit/32c7bcc0f233285ba27dec73a4b1e81fb7a219b3)) ### Reverts -* Revert "chore: expose fromDataToStream to be consumable (#6731)" (#6732) ([1317261](https://github.com/axios/axios/commit/1317261125e9c419fe9f126867f64d28f9c1efda)), closes [#6731](https://github.com/axios/axios/issues/6731) [#6732](https://github.com/axios/axios/issues/6732) - +- Revert "chore: expose fromDataToStream to be consumable (#6731)" (#6732) ([1317261](https://github.com/axios/axios/commit/1317261125e9c419fe9f126867f64d28f9c1efda)), closes [#6731](https://github.com/axios/axios/issues/6731) [#6732](https://github.com/axios/axios/issues/6732) ### BREAKING CHANGES -* code relying on the above will now combine the URLs instead of prefer request URL +- code relying on the above will now combine the URLs instead of prefer request URL -* feat: add config option for allowing absolute URLs +- feat: add config option for allowing absolute URLs -* fix: add default value for allowAbsoluteUrls in buildFullPath +- fix: add default value for allowAbsoluteUrls in buildFullPath -* fix: typo in flow control when setting allowAbsoluteUrls +- fix: typo in flow control when setting allowAbsoluteUrls ### Contributors to this release @@ -355,10 +330,9 @@ ## [1.7.9](https://github.com/axios/axios/compare/v1.7.8...v1.7.9) (2024-12-04) - ### Reverts -* Revert "fix(types): export CJS types from ESM (#6218)" (#6729) ([c44d2f2](https://github.com/axios/axios/commit/c44d2f2316ad289b38997657248ba10de11deb6c)), closes [#6218](https://github.com/axios/axios/issues/6218) [#6729](https://github.com/axios/axios/issues/6729) +- Revert "fix(types): export CJS types from ESM (#6218)" (#6729) ([c44d2f2](https://github.com/axios/axios/commit/c44d2f2316ad289b38997657248ba10de11deb6c)), closes [#6218](https://github.com/axios/axios/issues/6218) [#6729](https://github.com/axios/axios/issues/6729) ### Contributors to this release @@ -366,20 +340,19 @@ ## [1.7.8](https://github.com/axios/axios/compare/v1.7.7...v1.7.8) (2024-11-25) - ### Bug Fixes -* allow passing a callback as paramsSerializer to buildURL ([#6680](https://github.com/axios/axios/issues/6680)) ([eac4619](https://github.com/axios/axios/commit/eac4619fe2e0926e876cd260ee21e3690381dbb5)) -* **core:** fixed config merging bug ([#6668](https://github.com/axios/axios/issues/6668)) ([5d99fe4](https://github.com/axios/axios/commit/5d99fe4491202a6268c71e5dcc09192359d73cea)) -* fixed width form to not shrink after 'Send Request' button is clicked ([#6644](https://github.com/axios/axios/issues/6644)) ([7ccd5fd](https://github.com/axios/axios/commit/7ccd5fd42402102d38712c32707bf055be72ab54)) -* **http:** add support for File objects as payload in http adapter ([#6588](https://github.com/axios/axios/issues/6588)) ([#6605](https://github.com/axios/axios/issues/6605)) ([6841d8d](https://github.com/axios/axios/commit/6841d8d18ddc71cc1bd202ffcfddb3f95622eef3)) -* **http:** fixed proxy-from-env module import ([#5222](https://github.com/axios/axios/issues/5222)) ([12b3295](https://github.com/axios/axios/commit/12b32957f1258aee94ef859809ed39f8f88f9dfa)) -* **http:** use `globalThis.TextEncoder` when available ([#6634](https://github.com/axios/axios/issues/6634)) ([df956d1](https://github.com/axios/axios/commit/df956d18febc9100a563298dfdf0f102c3d15410)) -* ios11 breaks when build ([#6608](https://github.com/axios/axios/issues/6608)) ([7638952](https://github.com/axios/axios/commit/763895270f7b50c7c780c3c9807ae8635de952cd)) -* **types:** add missing types for mergeConfig function ([#6590](https://github.com/axios/axios/issues/6590)) ([00de614](https://github.com/axios/axios/commit/00de614cd07b7149af335e202aef0e076c254f49)) -* **types:** export CJS types from ESM ([#6218](https://github.com/axios/axios/issues/6218)) ([c71811b](https://github.com/axios/axios/commit/c71811b00f2fcff558e4382ba913bdac4ad7200e)) -* updated stream aborted error message to be more clear ([#6615](https://github.com/axios/axios/issues/6615)) ([cc3217a](https://github.com/axios/axios/commit/cc3217a612024d83a663722a56d7a98d8759c6d5)) -* use URL API instead of DOM to fix a potential vulnerability warning; ([#6714](https://github.com/axios/axios/issues/6714)) ([0a8d6e1](https://github.com/axios/axios/commit/0a8d6e19da5b9899a2abafaaa06a75ee548597db)) +- allow passing a callback as paramsSerializer to buildURL ([#6680](https://github.com/axios/axios/issues/6680)) ([eac4619](https://github.com/axios/axios/commit/eac4619fe2e0926e876cd260ee21e3690381dbb5)) +- **core:** fixed config merging bug ([#6668](https://github.com/axios/axios/issues/6668)) ([5d99fe4](https://github.com/axios/axios/commit/5d99fe4491202a6268c71e5dcc09192359d73cea)) +- fixed width form to not shrink after 'Send Request' button is clicked ([#6644](https://github.com/axios/axios/issues/6644)) ([7ccd5fd](https://github.com/axios/axios/commit/7ccd5fd42402102d38712c32707bf055be72ab54)) +- **http:** add support for File objects as payload in http adapter ([#6588](https://github.com/axios/axios/issues/6588)) ([#6605](https://github.com/axios/axios/issues/6605)) ([6841d8d](https://github.com/axios/axios/commit/6841d8d18ddc71cc1bd202ffcfddb3f95622eef3)) +- **http:** fixed proxy-from-env module import ([#5222](https://github.com/axios/axios/issues/5222)) ([12b3295](https://github.com/axios/axios/commit/12b32957f1258aee94ef859809ed39f8f88f9dfa)) +- **http:** use `globalThis.TextEncoder` when available ([#6634](https://github.com/axios/axios/issues/6634)) ([df956d1](https://github.com/axios/axios/commit/df956d18febc9100a563298dfdf0f102c3d15410)) +- ios11 breaks when build ([#6608](https://github.com/axios/axios/issues/6608)) ([7638952](https://github.com/axios/axios/commit/763895270f7b50c7c780c3c9807ae8635de952cd)) +- **types:** add missing types for mergeConfig function ([#6590](https://github.com/axios/axios/issues/6590)) ([00de614](https://github.com/axios/axios/commit/00de614cd07b7149af335e202aef0e076c254f49)) +- **types:** export CJS types from ESM ([#6218](https://github.com/axios/axios/issues/6218)) ([c71811b](https://github.com/axios/axios/commit/c71811b00f2fcff558e4382ba913bdac4ad7200e)) +- updated stream aborted error message to be more clear ([#6615](https://github.com/axios/axios/issues/6615)) ([cc3217a](https://github.com/axios/axios/commit/cc3217a612024d83a663722a56d7a98d8759c6d5)) +- use URL API instead of DOM to fix a potential vulnerability warning; ([#6714](https://github.com/axios/axios/issues/6714)) ([0a8d6e1](https://github.com/axios/axios/commit/0a8d6e19da5b9899a2abafaaa06a75ee548597db)) ### Contributors to this release @@ -404,11 +377,10 @@ ## [1.7.7](https://github.com/axios/axios/compare/v1.7.6...v1.7.7) (2024-08-31) - ### Bug Fixes -* **fetch:** fix stream handling in Safari by fallback to using a stream reader instead of an async iterator; ([#6584](https://github.com/axios/axios/issues/6584)) ([d198085](https://github.com/axios/axios/commit/d1980854fee1765cd02fa0787adf5d6e34dd9dcf)) -* **http:** fixed support for IPv6 literal strings in url ([#5731](https://github.com/axios/axios/issues/5731)) ([364993f](https://github.com/axios/axios/commit/364993f0d8bc6e0e06f76b8a35d2d0a35cab054c)) +- **fetch:** fix stream handling in Safari by fallback to using a stream reader instead of an async iterator; ([#6584](https://github.com/axios/axios/issues/6584)) ([d198085](https://github.com/axios/axios/commit/d1980854fee1765cd02fa0787adf5d6e34dd9dcf)) +- **http:** fixed support for IPv6 literal strings in url ([#5731](https://github.com/axios/axios/issues/5731)) ([364993f](https://github.com/axios/axios/commit/364993f0d8bc6e0e06f76b8a35d2d0a35cab054c)) ### Contributors to this release @@ -417,11 +389,10 @@ ## [1.7.6](https://github.com/axios/axios/compare/v1.7.5...v1.7.6) (2024-08-30) - ### Bug Fixes -* **fetch:** fix content length calculation for FormData payload; ([#6524](https://github.com/axios/axios/issues/6524)) ([085f568](https://github.com/axios/axios/commit/085f56861a83e9ac02c140ad9d68dac540dfeeaa)) -* **fetch:** optimize signals composing logic; ([#6582](https://github.com/axios/axios/issues/6582)) ([df9889b](https://github.com/axios/axios/commit/df9889b83c2cc37e9e6189675a73ab70c60f031f)) +- **fetch:** fix content length calculation for FormData payload; ([#6524](https://github.com/axios/axios/issues/6524)) ([085f568](https://github.com/axios/axios/commit/085f56861a83e9ac02c140ad9d68dac540dfeeaa)) +- **fetch:** optimize signals composing logic; ([#6582](https://github.com/axios/axios/issues/6582)) ([df9889b](https://github.com/axios/axios/commit/df9889b83c2cc37e9e6189675a73ab70c60f031f)) ### Contributors to this release @@ -431,13 +402,12 @@ ## [1.7.5](https://github.com/axios/axios/compare/v1.7.4...v1.7.5) (2024-08-23) - ### Bug Fixes -* **adapter:** fix undefined reference to hasBrowserEnv ([#6572](https://github.com/axios/axios/issues/6572)) ([7004707](https://github.com/axios/axios/commit/7004707c4180b416341863bd86913fe4fc2f1df1)) -* **core:** add the missed implementation of AxiosError#status property; ([#6573](https://github.com/axios/axios/issues/6573)) ([6700a8a](https://github.com/axios/axios/commit/6700a8adac06942205f6a7a21421ecb36c4e0852)) -* **core:** fix `ReferenceError: navigator is not defined` for custom environments; ([#6567](https://github.com/axios/axios/issues/6567)) ([fed1a4b](https://github.com/axios/axios/commit/fed1a4b2d78ed4a588c84e09d32749ed01dc2794)) -* **fetch:** fix credentials handling in Cloudflare workers ([#6533](https://github.com/axios/axios/issues/6533)) ([550d885](https://github.com/axios/axios/commit/550d885eb90fd156add7b93bbdc54d30d2f9a98d)) +- **adapter:** fix undefined reference to hasBrowserEnv ([#6572](https://github.com/axios/axios/issues/6572)) ([7004707](https://github.com/axios/axios/commit/7004707c4180b416341863bd86913fe4fc2f1df1)) +- **core:** add the missed implementation of AxiosError#status property; ([#6573](https://github.com/axios/axios/issues/6573)) ([6700a8a](https://github.com/axios/axios/commit/6700a8adac06942205f6a7a21421ecb36c4e0852)) +- **core:** fix `ReferenceError: navigator is not defined` for custom environments; ([#6567](https://github.com/axios/axios/issues/6567)) ([fed1a4b](https://github.com/axios/axios/commit/fed1a4b2d78ed4a588c84e09d32749ed01dc2794)) +- **fetch:** fix credentials handling in Cloudflare workers ([#6533](https://github.com/axios/axios/issues/6533)) ([550d885](https://github.com/axios/axios/commit/550d885eb90fd156add7b93bbdc54d30d2f9a98d)) ### Contributors to this release @@ -447,11 +417,10 @@ ## [1.7.4](https://github.com/axios/axios/compare/v1.7.3...v1.7.4) (2024-08-13) - ### Bug Fixes -* **sec:** CVE-2024-39338 ([#6539](https://github.com/axios/axios/issues/6539)) ([#6543](https://github.com/axios/axios/issues/6543)) ([6b6b605](https://github.com/axios/axios/commit/6b6b605eaf73852fb2dae033f1e786155959de3a)) -* **sec:** disregard protocol-relative URL to remediate SSRF ([#6539](https://github.com/axios/axios/issues/6539)) ([07a661a](https://github.com/axios/axios/commit/07a661a2a6b9092c4aa640dcc7f724ec5e65bdda)) +- **sec:** CVE-2024-39338 ([#6539](https://github.com/axios/axios/issues/6539)) ([#6543](https://github.com/axios/axios/issues/6543)) ([6b6b605](https://github.com/axios/axios/commit/6b6b605eaf73852fb2dae033f1e786155959de3a)) +- **sec:** disregard protocol-relative URL to remediate SSRF ([#6539](https://github.com/axios/axios/issues/6539)) ([07a661a](https://github.com/axios/axios/commit/07a661a2a6b9092c4aa640dcc7f724ec5e65bdda)) ### Contributors to this release @@ -460,12 +429,11 @@ ## [1.7.3](https://github.com/axios/axios/compare/v1.7.2...v1.7.3) (2024-08-01) - ### Bug Fixes -* **adapter:** fix progress event emitting; ([#6518](https://github.com/axios/axios/issues/6518)) ([e3c76fc](https://github.com/axios/axios/commit/e3c76fc9bdd03aa4d98afaf211df943e2031453f)) -* **fetch:** fix withCredentials request config ([#6505](https://github.com/axios/axios/issues/6505)) ([85d4d0e](https://github.com/axios/axios/commit/85d4d0ea0aae91082f04e303dec46510d1b4e787)) -* **xhr:** return original config on errors from XHR adapter ([#6515](https://github.com/axios/axios/issues/6515)) ([8966ee7](https://github.com/axios/axios/commit/8966ee7ea62ecbd6cfb39a905939bcdab5cf6388)) +- **adapter:** fix progress event emitting; ([#6518](https://github.com/axios/axios/issues/6518)) ([e3c76fc](https://github.com/axios/axios/commit/e3c76fc9bdd03aa4d98afaf211df943e2031453f)) +- **fetch:** fix withCredentials request config ([#6505](https://github.com/axios/axios/issues/6505)) ([85d4d0e](https://github.com/axios/axios/commit/85d4d0ea0aae91082f04e303dec46510d1b4e787)) +- **xhr:** return original config on errors from XHR adapter ([#6515](https://github.com/axios/axios/issues/6515)) ([8966ee7](https://github.com/axios/axios/commit/8966ee7ea62ecbd6cfb39a905939bcdab5cf6388)) ### Contributors to this release @@ -475,10 +443,9 @@ ## [1.7.2](https://github.com/axios/axios/compare/v1.7.1...v1.7.2) (2024-05-21) - ### Bug Fixes -* **fetch:** enhance fetch API detection; ([#6413](https://github.com/axios/axios/issues/6413)) ([4f79aef](https://github.com/axios/axios/commit/4f79aef81b7c4644328365bfc33acf0a9ef595bc)) +- **fetch:** enhance fetch API detection; ([#6413](https://github.com/axios/axios/issues/6413)) ([4f79aef](https://github.com/axios/axios/commit/4f79aef81b7c4644328365bfc33acf0a9ef595bc)) ### Contributors to this release @@ -486,10 +453,9 @@ ## [1.7.1](https://github.com/axios/axios/compare/v1.7.0...v1.7.1) (2024-05-20) - ### Bug Fixes -* **fetch:** fixed ReferenceError issue when TextEncoder is not available in the environment; ([#6410](https://github.com/axios/axios/issues/6410)) ([733f15f](https://github.com/axios/axios/commit/733f15fe5bd2d67e1fadaee82e7913b70d45dc5e)) +- **fetch:** fixed ReferenceError issue when TextEncoder is not available in the environment; ([#6410](https://github.com/axios/axios/issues/6410)) ([733f15f](https://github.com/axios/axios/commit/733f15fe5bd2d67e1fadaee82e7913b70d45dc5e)) ### Contributors to this release @@ -497,14 +463,13 @@ # [1.7.0](https://github.com/axios/axios/compare/v1.7.0-beta.2...v1.7.0) (2024-05-19) - ### Features -* **adapter:** add fetch adapter; ([#6371](https://github.com/axios/axios/issues/6371)) ([a3ff99b](https://github.com/axios/axios/commit/a3ff99b59d8ec2ab5dd049e68c043617a4072e42)) +- **adapter:** add fetch adapter; ([#6371](https://github.com/axios/axios/issues/6371)) ([a3ff99b](https://github.com/axios/axios/commit/a3ff99b59d8ec2ab5dd049e68c043617a4072e42)) ### Bug Fixes -* **core/axios:** handle un-writable error stack ([#6362](https://github.com/axios/axios/issues/6362)) ([81e0455](https://github.com/axios/axios/commit/81e0455b7b57fbaf2be16a73ebe0e6591cc6d8f9)) +- **core/axios:** handle un-writable error stack ([#6362](https://github.com/axios/axios/issues/6362)) ([81e0455](https://github.com/axios/axios/commit/81e0455b7b57fbaf2be16a73ebe0e6591cc6d8f9)) ### Contributors to this release @@ -514,12 +479,11 @@ # [1.7.0-beta.2](https://github.com/axios/axios/compare/v1.7.0-beta.1...v1.7.0-beta.2) (2024-05-19) - ### Bug Fixes -* **fetch:** capitalize HTTP method names; ([#6395](https://github.com/axios/axios/issues/6395)) ([ad3174a](https://github.com/axios/axios/commit/ad3174a3515c3c2573f4bcb94818d582826f3914)) -* **fetch:** fix & optimize progress capturing for cases when the request data has a nullish value or zero data length ([#6400](https://github.com/axios/axios/issues/6400)) ([95a3e8e](https://github.com/axios/axios/commit/95a3e8e346cfd6a5548e171f2341df3235d0e26b)) -* **fetch:** fix headers getting from a stream response; ([#6401](https://github.com/axios/axios/issues/6401)) ([870e0a7](https://github.com/axios/axios/commit/870e0a76f60d0094774a6a63fa606eec52a381af)) +- **fetch:** capitalize HTTP method names; ([#6395](https://github.com/axios/axios/issues/6395)) ([ad3174a](https://github.com/axios/axios/commit/ad3174a3515c3c2573f4bcb94818d582826f3914)) +- **fetch:** fix & optimize progress capturing for cases when the request data has a nullish value or zero data length ([#6400](https://github.com/axios/axios/issues/6400)) ([95a3e8e](https://github.com/axios/axios/commit/95a3e8e346cfd6a5548e171f2341df3235d0e26b)) +- **fetch:** fix headers getting from a stream response; ([#6401](https://github.com/axios/axios/issues/6401)) ([870e0a7](https://github.com/axios/axios/commit/870e0a76f60d0094774a6a63fa606eec52a381af)) ### Contributors to this release @@ -527,12 +491,11 @@ # [1.7.0-beta.1](https://github.com/axios/axios/compare/v1.7.0-beta.0...v1.7.0-beta.1) (2024-05-07) - ### Bug Fixes -* **core/axios:** handle un-writable error stack ([#6362](https://github.com/axios/axios/issues/6362)) ([81e0455](https://github.com/axios/axios/commit/81e0455b7b57fbaf2be16a73ebe0e6591cc6d8f9)) -* **fetch:** fix cases when ReadableStream or Response.body are not available; ([#6377](https://github.com/axios/axios/issues/6377)) ([d1d359d](https://github.com/axios/axios/commit/d1d359da347704e8b28d768e61515a3e96c5b072)) -* **fetch:** treat fetch-related TypeError as an AxiosError.ERR_NETWORK error; ([#6380](https://github.com/axios/axios/issues/6380)) ([bb5f9a5](https://github.com/axios/axios/commit/bb5f9a5ab768452de9e166dc28d0ffc234245ef1)) +- **core/axios:** handle un-writable error stack ([#6362](https://github.com/axios/axios/issues/6362)) ([81e0455](https://github.com/axios/axios/commit/81e0455b7b57fbaf2be16a73ebe0e6591cc6d8f9)) +- **fetch:** fix cases when ReadableStream or Response.body are not available; ([#6377](https://github.com/axios/axios/issues/6377)) ([d1d359d](https://github.com/axios/axios/commit/d1d359da347704e8b28d768e61515a3e96c5b072)) +- **fetch:** treat fetch-related TypeError as an AxiosError.ERR_NETWORK error; ([#6380](https://github.com/axios/axios/issues/6380)) ([bb5f9a5](https://github.com/axios/axios/commit/bb5f9a5ab768452de9e166dc28d0ffc234245ef1)) ### Contributors to this release @@ -541,10 +504,9 @@ # [1.7.0-beta.0](https://github.com/axios/axios/compare/v1.6.8...v1.7.0-beta.0) (2024-04-28) - ### Features -* **adapter:** add fetch adapter; ([#6371](https://github.com/axios/axios/issues/6371)) ([a3ff99b](https://github.com/axios/axios/commit/a3ff99b59d8ec2ab5dd049e68c043617a4072e42)) +- **adapter:** add fetch adapter; ([#6371](https://github.com/axios/axios/issues/6371)) ([a3ff99b](https://github.com/axios/axios/commit/a3ff99b59d8ec2ab5dd049e68c043617a4072e42)) ### Contributors to this release @@ -553,12 +515,11 @@ ## [1.6.8](https://github.com/axios/axios/compare/v1.6.7...v1.6.8) (2024-03-15) - ### Bug Fixes -* **AxiosHeaders:** fix AxiosHeaders conversion to an object during config merging ([#6243](https://github.com/axios/axios/issues/6243)) ([2656612](https://github.com/axios/axios/commit/2656612bc10fe2757e9832b708ed773ab340b5cb)) -* **import:** use named export for EventEmitter; ([7320430](https://github.com/axios/axios/commit/7320430aef2e1ba2b89488a0eaf42681165498b1)) -* **vulnerability:** update follow-redirects to 1.15.6 ([#6300](https://github.com/axios/axios/issues/6300)) ([8786e0f](https://github.com/axios/axios/commit/8786e0ff55a8c68d4ca989801ad26df924042e27)) +- **AxiosHeaders:** fix AxiosHeaders conversion to an object during config merging ([#6243](https://github.com/axios/axios/issues/6243)) ([2656612](https://github.com/axios/axios/commit/2656612bc10fe2757e9832b708ed773ab340b5cb)) +- **import:** use named export for EventEmitter; ([7320430](https://github.com/axios/axios/commit/7320430aef2e1ba2b89488a0eaf42681165498b1)) +- **vulnerability:** update follow-redirects to 1.15.6 ([#6300](https://github.com/axios/axios/issues/6300)) ([8786e0f](https://github.com/axios/axios/commit/8786e0ff55a8c68d4ca989801ad26df924042e27)) ### Contributors to this release @@ -572,10 +533,9 @@ ## [1.6.7](https://github.com/axios/axios/compare/v1.6.6...v1.6.7) (2024-01-25) - ### Bug Fixes -* capture async stack only for rejections with native error objects; ([#6203](https://github.com/axios/axios/issues/6203)) ([1a08f90](https://github.com/axios/axios/commit/1a08f90f402336e4d00e9ee82f211c6adb1640b0)) +- capture async stack only for rejections with native error objects; ([#6203](https://github.com/axios/axios/issues/6203)) ([1a08f90](https://github.com/axios/axios/commit/1a08f90f402336e4d00e9ee82f211c6adb1640b0)) ### Contributors to this release @@ -584,11 +544,10 @@ ## [1.6.6](https://github.com/axios/axios/compare/v1.6.5...v1.6.6) (2024-01-24) - ### Bug Fixes -* fixed missed dispatchBeforeRedirect argument ([#5778](https://github.com/axios/axios/issues/5778)) ([a1938ff](https://github.com/axios/axios/commit/a1938ff073fcb0f89011f001dfbc1fa1dc995e39)) -* wrap errors to improve async stack trace ([#5987](https://github.com/axios/axios/issues/5987)) ([123f354](https://github.com/axios/axios/commit/123f354b920f154a209ea99f76b7b2ef3d9ebbab)) +- fixed missed dispatchBeforeRedirect argument ([#5778](https://github.com/axios/axios/issues/5778)) ([a1938ff](https://github.com/axios/axios/commit/a1938ff073fcb0f89011f001dfbc1fa1dc995e39)) +- wrap errors to improve async stack trace ([#5987](https://github.com/axios/axios/issues/5987)) ([123f354](https://github.com/axios/axios/commit/123f354b920f154a209ea99f76b7b2ef3d9ebbab)) ### Contributors to this release @@ -597,11 +556,10 @@ ## [1.6.5](https://github.com/axios/axios/compare/v1.6.4...v1.6.5) (2024-01-05) - ### Bug Fixes -* **ci:** refactor notify action as a job of publish action; ([#6176](https://github.com/axios/axios/issues/6176)) ([0736f95](https://github.com/axios/axios/commit/0736f95ce8776366dc9ca569f49ba505feb6373c)) -* **dns:** fixed lookup error handling; ([#6175](https://github.com/axios/axios/issues/6175)) ([f4f2b03](https://github.com/axios/axios/commit/f4f2b039dd38eb4829e8583caede4ed6d2dd59be)) +- **ci:** refactor notify action as a job of publish action; ([#6176](https://github.com/axios/axios/issues/6176)) ([0736f95](https://github.com/axios/axios/commit/0736f95ce8776366dc9ca569f49ba505feb6373c)) +- **dns:** fixed lookup error handling; ([#6175](https://github.com/axios/axios/issues/6175)) ([f4f2b03](https://github.com/axios/axios/commit/f4f2b039dd38eb4829e8583caede4ed6d2dd59be)) ### Contributors to this release @@ -610,11 +568,10 @@ ## [1.6.4](https://github.com/axios/axios/compare/v1.6.3...v1.6.4) (2024-01-03) - ### Bug Fixes -* **security:** fixed formToJSON prototype pollution vulnerability; ([#6167](https://github.com/axios/axios/issues/6167)) ([3c0c11c](https://github.com/axios/axios/commit/3c0c11cade045c4412c242b5727308cff9897a0e)) -* **security:** fixed security vulnerability in follow-redirects ([#6163](https://github.com/axios/axios/issues/6163)) ([75af1cd](https://github.com/axios/axios/commit/75af1cdff5b3a6ca3766d3d3afbc3115bb0811b8)) +- **security:** fixed formToJSON prototype pollution vulnerability; ([#6167](https://github.com/axios/axios/issues/6167)) ([3c0c11c](https://github.com/axios/axios/commit/3c0c11cade045c4412c242b5727308cff9897a0e)) +- **security:** fixed security vulnerability in follow-redirects ([#6163](https://github.com/axios/axios/issues/6163)) ([75af1cd](https://github.com/axios/axios/commit/75af1cdff5b3a6ca3766d3d3afbc3115bb0811b8)) ### Contributors to this release @@ -624,10 +581,9 @@ ## [1.6.3](https://github.com/axios/axios/compare/v1.6.2...v1.6.3) (2023-12-26) - ### Bug Fixes -* Regular Expression Denial of Service (ReDoS) ([#6132](https://github.com/axios/axios/issues/6132)) ([5e7ad38](https://github.com/axios/axios/commit/5e7ad38fb0f819fceb19fb2ee5d5d38f56aa837d)) +- Regular Expression Denial of Service (ReDoS) ([#6132](https://github.com/axios/axios/issues/6132)) ([5e7ad38](https://github.com/axios/axios/commit/5e7ad38fb0f819fceb19fb2ee5d5d38f56aa837d)) ### Contributors to this release @@ -637,16 +593,17 @@ ## [1.6.2](https://github.com/axios/axios/compare/v1.6.1...v1.6.2) (2023-11-14) - ### Features -* **withXSRFToken:** added withXSRFToken option as a workaround to achieve the old `withCredentials` behavior; ([#6046](https://github.com/axios/axios/issues/6046)) ([cff9967](https://github.com/axios/axios/commit/cff996779b272a5e94c2b52f5503ccf668bc42dc)) +- **withXSRFToken:** added withXSRFToken option as a workaround to achieve the old `withCredentials` behavior; ([#6046](https://github.com/axios/axios/issues/6046)) ([cff9967](https://github.com/axios/axios/commit/cff996779b272a5e94c2b52f5503ccf668bc42dc)) ### PRs + - feat(withXSRFToken): added withXSRFToken option as a workaround to achieve the old `withCredentials` behavior; ( [#6046](https://api.github.com/repos/axios/axios/pulls/6046) ) + ``` -📢 This PR added 'withXSRFToken' option as a replacement for old withCredentials behaviour. +📢 This PR added 'withXSRFToken' option as a replacement for old withCredentials behaviour. You should now use withXSRFToken along with withCredential to get the old behavior. This functionality is considered as a fix. ``` @@ -659,11 +616,10 @@ This functionality is considered as a fix. ## [1.6.1](https://github.com/axios/axios/compare/v1.6.0...v1.6.1) (2023-11-08) - ### Bug Fixes -* **formdata:** fixed content-type header normalization for non-standard browser environments; ([#6056](https://github.com/axios/axios/issues/6056)) ([dd465ab](https://github.com/axios/axios/commit/dd465ab22bbfa262c6567be6574bf46a057d5288)) -* **platform:** fixed emulated browser detection in node.js environment; ([#6055](https://github.com/axios/axios/issues/6055)) ([3dc8369](https://github.com/axios/axios/commit/3dc8369e505e32a4e12c22f154c55fd63ac67fbb)) +- **formdata:** fixed content-type header normalization for non-standard browser environments; ([#6056](https://github.com/axios/axios/issues/6056)) ([dd465ab](https://github.com/axios/axios/commit/dd465ab22bbfa262c6567be6574bf46a057d5288)) +- **platform:** fixed emulated browser detection in node.js environment; ([#6055](https://github.com/axios/axios/issues/6055)) ([3dc8369](https://github.com/axios/axios/commit/3dc8369e505e32a4e12c22f154c55fd63ac67fbb)) ### Contributors to this release @@ -671,25 +627,28 @@ This functionality is considered as a fix. - avatar [Fabian Meyer](https://github.com/meyfa "+5/-2 (#5835 )") ### PRs + - feat(withXSRFToken): added withXSRFToken option as a workaround to achieve the old `withCredentials` behavior; ( [#6046](https://api.github.com/repos/axios/axios/pulls/6046) ) + ``` -📢 This PR added 'withXSRFToken' option as a replacement for old withCredentials behaviour. +📢 This PR added 'withXSRFToken' option as a replacement for old withCredentials behaviour. You should now use withXSRFToken along with withCredential to get the old behavior. This functionality is considered as a fix. ``` # [1.6.0](https://github.com/axios/axios/compare/v1.5.1...v1.6.0) (2023-10-26) - ### Bug Fixes -* **CSRF:** fixed CSRF vulnerability CVE-2023-45857 ([#6028](https://github.com/axios/axios/issues/6028)) ([96ee232](https://github.com/axios/axios/commit/96ee232bd3ee4de2e657333d4d2191cd389e14d0)) -* **dns:** fixed lookup function decorator to work properly in node v20; ([#6011](https://github.com/axios/axios/issues/6011)) ([5aaff53](https://github.com/axios/axios/commit/5aaff532a6b820bb9ab6a8cd0f77131b47e2adb8)) -* **types:** fix AxiosHeaders types; ([#5931](https://github.com/axios/axios/issues/5931)) ([a1c8ad0](https://github.com/axios/axios/commit/a1c8ad008b3c13d53e135bbd0862587fb9d3fc09)) +- **CSRF:** fixed CSRF vulnerability CVE-2023-45857 ([#6028](https://github.com/axios/axios/issues/6028)) ([96ee232](https://github.com/axios/axios/commit/96ee232bd3ee4de2e657333d4d2191cd389e14d0)) +- **dns:** fixed lookup function decorator to work properly in node v20; ([#6011](https://github.com/axios/axios/issues/6011)) ([5aaff53](https://github.com/axios/axios/commit/5aaff532a6b820bb9ab6a8cd0f77131b47e2adb8)) +- **types:** fix AxiosHeaders types; ([#5931](https://github.com/axios/axios/issues/5931)) ([a1c8ad0](https://github.com/axios/axios/commit/a1c8ad008b3c13d53e135bbd0862587fb9d3fc09)) ### PRs + - CVE 2023 45857 ( [#6028](https://api.github.com/repos/axios/axios/pulls/6028) ) + ``` ⚠️ Critical vulnerability fix. See https://security.snyk.io/vuln/SNYK-JS-AXIOS-6032459 @@ -703,13 +662,12 @@ This functionality is considered as a fix. ## [1.5.1](https://github.com/axios/axios/compare/v1.5.0...v1.5.1) (2023-09-26) - ### Bug Fixes -* **adapters:** improved adapters loading logic to have clear error messages; ([#5919](https://github.com/axios/axios/issues/5919)) ([e410779](https://github.com/axios/axios/commit/e4107797a7a1376f6209fbecfbbce73d3faa7859)) -* **formdata:** fixed automatic addition of the `Content-Type` header for FormData in non-browser environments; ([#5917](https://github.com/axios/axios/issues/5917)) ([bc9af51](https://github.com/axios/axios/commit/bc9af51b1886d1b3529617702f2a21a6c0ed5d92)) -* **headers:** allow `content-encoding` header to handle case-insensitive values ([#5890](https://github.com/axios/axios/issues/5890)) ([#5892](https://github.com/axios/axios/issues/5892)) ([4c89f25](https://github.com/axios/axios/commit/4c89f25196525e90a6e75eda9cb31ae0a2e18acd)) -* **types:** removed duplicated code ([9e62056](https://github.com/axios/axios/commit/9e6205630e1c9cf863adf141c0edb9e6d8d4b149)) +- **adapters:** improved adapters loading logic to have clear error messages; ([#5919](https://github.com/axios/axios/issues/5919)) ([e410779](https://github.com/axios/axios/commit/e4107797a7a1376f6209fbecfbbce73d3faa7859)) +- **formdata:** fixed automatic addition of the `Content-Type` header for FormData in non-browser environments; ([#5917](https://github.com/axios/axios/issues/5917)) ([bc9af51](https://github.com/axios/axios/commit/bc9af51b1886d1b3529617702f2a21a6c0ed5d92)) +- **headers:** allow `content-encoding` header to handle case-insensitive values ([#5890](https://github.com/axios/axios/issues/5890)) ([#5892](https://github.com/axios/axios/issues/5892)) ([4c89f25](https://github.com/axios/axios/commit/4c89f25196525e90a6e75eda9cb31ae0a2e18acd)) +- **types:** removed duplicated code ([9e62056](https://github.com/axios/axios/commit/9e6205630e1c9cf863adf141c0edb9e6d8d4b149)) ### Contributors to this release @@ -721,7 +679,9 @@ This functionality is considered as a fix. - avatar [Michael Di Prisco](https://github.com/Cadienvan "+1/-1 ()") ### PRs + - CVE 2023 45857 ( [#6028](https://api.github.com/repos/axios/axios/pulls/6028) ) + ``` ⚠️ Critical vulnerability fix. See https://security.snyk.io/vuln/SNYK-JS-AXIOS-6032459 @@ -729,19 +689,17 @@ This functionality is considered as a fix. # [1.5.0](https://github.com/axios/axios/compare/v1.4.0...v1.5.0) (2023-08-26) - ### Bug Fixes -* **adapter:** make adapter loading error more clear by using platform-specific adapters explicitly ([#5837](https://github.com/axios/axios/issues/5837)) ([9a414bb](https://github.com/axios/axios/commit/9a414bb6c81796a95c6c7fe668637825458e8b6d)) -* **dns:** fixed `cacheable-lookup` integration; ([#5836](https://github.com/axios/axios/issues/5836)) ([b3e327d](https://github.com/axios/axios/commit/b3e327dcc9277bdce34c7ef57beedf644b00d628)) -* **headers:** added support for setting header names that overlap with class methods; ([#5831](https://github.com/axios/axios/issues/5831)) ([d8b4ca0](https://github.com/axios/axios/commit/d8b4ca0ea5f2f05efa4edfe1e7684593f9f68273)) -* **headers:** fixed common Content-Type header merging; ([#5832](https://github.com/axios/axios/issues/5832)) ([8fda276](https://github.com/axios/axios/commit/8fda2766b1e6bcb72c3fabc146223083ef13ce17)) - +- **adapter:** make adapter loading error more clear by using platform-specific adapters explicitly ([#5837](https://github.com/axios/axios/issues/5837)) ([9a414bb](https://github.com/axios/axios/commit/9a414bb6c81796a95c6c7fe668637825458e8b6d)) +- **dns:** fixed `cacheable-lookup` integration; ([#5836](https://github.com/axios/axios/issues/5836)) ([b3e327d](https://github.com/axios/axios/commit/b3e327dcc9277bdce34c7ef57beedf644b00d628)) +- **headers:** added support for setting header names that overlap with class methods; ([#5831](https://github.com/axios/axios/issues/5831)) ([d8b4ca0](https://github.com/axios/axios/commit/d8b4ca0ea5f2f05efa4edfe1e7684593f9f68273)) +- **headers:** fixed common Content-Type header merging; ([#5832](https://github.com/axios/axios/issues/5832)) ([8fda276](https://github.com/axios/axios/commit/8fda2766b1e6bcb72c3fabc146223083ef13ce17)) ### Features -* export getAdapter function ([#5324](https://github.com/axios/axios/issues/5324)) ([ca73eb8](https://github.com/axios/axios/commit/ca73eb878df0ae2dace81fe3a7f1fb5986231bf1)) -* **export:** export adapters without `unsafe` prefix ([#5839](https://github.com/axios/axios/issues/5839)) ([1601f4a](https://github.com/axios/axios/commit/1601f4a27a81ab47fea228f1e244b2c4e3ce28bf)) +- export getAdapter function ([#5324](https://github.com/axios/axios/issues/5324)) ([ca73eb8](https://github.com/axios/axios/commit/ca73eb878df0ae2dace81fe3a7f1fb5986231bf1)) +- **export:** export adapters without `unsafe` prefix ([#5839](https://github.com/axios/axios/issues/5839)) ([1601f4a](https://github.com/axios/axios/commit/1601f4a27a81ab47fea228f1e244b2c4e3ce28bf)) ### Contributors to this release @@ -751,7 +709,9 @@ This functionality is considered as a fix. - avatar [Michael Di Prisco](https://github.com/Cadienvan "+3/-5 (#5791 )") ### PRs + - CVE 2023 45857 ( [#6028](https://api.github.com/repos/axios/axios/pulls/6028) ) + ``` ⚠️ Critical vulnerability fix. See https://security.snyk.io/vuln/SNYK-JS-AXIOS-6032459 @@ -759,22 +719,19 @@ This functionality is considered as a fix. # [1.4.0](https://github.com/axios/axios/compare/v1.3.6...v1.4.0) (2023-04-27) - ### Bug Fixes -* **formdata:** add `multipart/form-data` content type for FormData payload on custom client environments; ([#5678](https://github.com/axios/axios/issues/5678)) ([bbb61e7](https://github.com/axios/axios/commit/bbb61e70cb1185adfb1cbbb86eaf6652c48d89d1)) -* **package:** export package internals with unsafe path prefix; ([#5677](https://github.com/axios/axios/issues/5677)) ([df38c94](https://github.com/axios/axios/commit/df38c949f26414d88ba29ec1e353c4d4f97eaf09)) - +- **formdata:** add `multipart/form-data` content type for FormData payload on custom client environments; ([#5678](https://github.com/axios/axios/issues/5678)) ([bbb61e7](https://github.com/axios/axios/commit/bbb61e70cb1185adfb1cbbb86eaf6652c48d89d1)) +- **package:** export package internals with unsafe path prefix; ([#5677](https://github.com/axios/axios/issues/5677)) ([df38c94](https://github.com/axios/axios/commit/df38c949f26414d88ba29ec1e353c4d4f97eaf09)) ### Features -* **dns:** added support for a custom lookup function; ([#5339](https://github.com/axios/axios/issues/5339)) ([2701911](https://github.com/axios/axios/commit/2701911260a1faa5cc5e1afe437121b330a3b7bb)) -* **types:** export `AxiosHeaderValue` type. ([#5525](https://github.com/axios/axios/issues/5525)) ([726f1c8](https://github.com/axios/axios/commit/726f1c8e00cffa0461a8813a9bdcb8f8b9d762cf)) - +- **dns:** added support for a custom lookup function; ([#5339](https://github.com/axios/axios/issues/5339)) ([2701911](https://github.com/axios/axios/commit/2701911260a1faa5cc5e1afe437121b330a3b7bb)) +- **types:** export `AxiosHeaderValue` type. ([#5525](https://github.com/axios/axios/issues/5525)) ([726f1c8](https://github.com/axios/axios/commit/726f1c8e00cffa0461a8813a9bdcb8f8b9d762cf)) ### Performance Improvements -* **merge-config:** optimize mergeConfig performance by avoiding duplicate key visits; ([#5679](https://github.com/axios/axios/issues/5679)) ([e6f7053](https://github.com/axios/axios/commit/e6f7053bf1a3e87cf1f9da8677e12e3fe829d68e)) +- **merge-config:** optimize mergeConfig performance by avoiding duplicate key visits; ([#5679](https://github.com/axios/axios/issues/5679)) ([e6f7053](https://github.com/axios/axios/commit/e6f7053bf1a3e87cf1f9da8677e12e3fe829d68e)) ### Contributors to this release @@ -783,7 +740,9 @@ This functionality is considered as a fix. - avatar [PIYUSH NEGI](https://github.com/npiyush97 "+2/-18 (#5670 )") ### PRs + - CVE 2023 45857 ( [#6028](https://api.github.com/repos/axios/axios/pulls/6028) ) + ``` ⚠️ Critical vulnerability fix. See https://security.snyk.io/vuln/SNYK-JS-AXIOS-6032459 @@ -791,11 +750,10 @@ This functionality is considered as a fix. ## [1.3.6](https://github.com/axios/axios/compare/v1.3.5...v1.3.6) (2023-04-19) - ### Bug Fixes -* **types:** added transport to RawAxiosRequestConfig ([#5445](https://github.com/axios/axios/issues/5445)) ([6f360a2](https://github.com/axios/axios/commit/6f360a2531d8d70363fd9becef6a45a323f170e2)) -* **utils:** make isFormData detection logic stricter to avoid unnecessary calling of the `toString` method on the target; ([#5661](https://github.com/axios/axios/issues/5661)) ([aa372f7](https://github.com/axios/axios/commit/aa372f7306295dfd1100c1c2c77ce95c95808e76)) +- **types:** added transport to RawAxiosRequestConfig ([#5445](https://github.com/axios/axios/issues/5445)) ([6f360a2](https://github.com/axios/axios/commit/6f360a2531d8d70363fd9becef6a45a323f170e2)) +- **utils:** make isFormData detection logic stricter to avoid unnecessary calling of the `toString` method on the target; ([#5661](https://github.com/axios/axios/issues/5661)) ([aa372f7](https://github.com/axios/axios/commit/aa372f7306295dfd1100c1c2c77ce95c95808e76)) ### Contributors to this release @@ -803,7 +761,9 @@ This functionality is considered as a fix. - avatar [Michael Di Prisco](https://github.com/Cadienvan "+2/-0 (#5445 )") ### PRs + - CVE 2023 45857 ( [#6028](https://api.github.com/repos/axios/axios/pulls/6028) ) + ``` ⚠️ Critical vulnerability fix. See https://security.snyk.io/vuln/SNYK-JS-AXIOS-6032459 @@ -811,18 +771,19 @@ This functionality is considered as a fix. ## [1.3.5](https://github.com/axios/axios/compare/v1.3.4...v1.3.5) (2023-04-05) - ### Bug Fixes -* **headers:** fixed isValidHeaderName to support full list of allowed characters; ([#5584](https://github.com/axios/axios/issues/5584)) ([e7decef](https://github.com/axios/axios/commit/e7decef6a99f4627e27ed9ea5b00ce8e201c3841)) -* **params:** re-added the ability to set the function as `paramsSerializer` config; ([#5633](https://github.com/axios/axios/issues/5633)) ([a56c866](https://github.com/axios/axios/commit/a56c8661209d5ce5a645a05f294a0e08a6c1f6b3)) +- **headers:** fixed isValidHeaderName to support full list of allowed characters; ([#5584](https://github.com/axios/axios/issues/5584)) ([e7decef](https://github.com/axios/axios/commit/e7decef6a99f4627e27ed9ea5b00ce8e201c3841)) +- **params:** re-added the ability to set the function as `paramsSerializer` config; ([#5633](https://github.com/axios/axios/issues/5633)) ([a56c866](https://github.com/axios/axios/commit/a56c8661209d5ce5a645a05f294a0e08a6c1f6b3)) ### Contributors to this release - avatar [Dmitriy Mozgovoy](https://github.com/DigitalBrainJS "+28/-10 (#5633 #5584 )") ### PRs + - CVE 2023 45857 ( [#6028](https://api.github.com/repos/axios/axios/pulls/6028) ) + ``` ⚠️ Critical vulnerability fix. See https://security.snyk.io/vuln/SNYK-JS-AXIOS-6032459 @@ -830,11 +791,10 @@ This functionality is considered as a fix. ## [1.3.4](https://github.com/axios/axios/compare/v1.3.3...v1.3.4) (2023-02-22) - ### Bug Fixes -* **blob:** added a check to make sure the Blob class is available in the browser's global scope; ([#5548](https://github.com/axios/axios/issues/5548)) ([3772c8f](https://github.com/axios/axios/commit/3772c8fe74112a56e3e9551f894d899bc3a9443a)) -* **http:** fixed regression bug when handling synchronous errors inside the adapter; ([#5564](https://github.com/axios/axios/issues/5564)) ([a3b246c](https://github.com/axios/axios/commit/a3b246c9de5c3bc4b5a742e15add55b375479451)) +- **blob:** added a check to make sure the Blob class is available in the browser's global scope; ([#5548](https://github.com/axios/axios/issues/5548)) ([3772c8f](https://github.com/axios/axios/commit/3772c8fe74112a56e3e9551f894d899bc3a9443a)) +- **http:** fixed regression bug when handling synchronous errors inside the adapter; ([#5564](https://github.com/axios/axios/issues/5564)) ([a3b246c](https://github.com/axios/axios/commit/a3b246c9de5c3bc4b5a742e15add55b375479451)) ### Contributors to this release @@ -843,7 +803,9 @@ This functionality is considered as a fix. - avatar [Michael Di Prisco](https://github.com/Cadienvan "+3/-0 (#5444 )") ### PRs + - CVE 2023 45857 ( [#6028](https://api.github.com/repos/axios/axios/pulls/6028) ) + ``` ⚠️ Critical vulnerability fix. See https://security.snyk.io/vuln/SNYK-JS-AXIOS-6032459 @@ -851,12 +813,11 @@ This functionality is considered as a fix. ## [1.3.3](https://github.com/axios/axios/compare/v1.3.2...v1.3.3) (2023-02-13) - ### Bug Fixes -* **formdata:** added a check to make sure the FormData class is available in the browser's global scope; ([#5545](https://github.com/axios/axios/issues/5545)) ([a6dfa72](https://github.com/axios/axios/commit/a6dfa72010db5ad52db8bd13c0f98e537e8fd05d)) -* **formdata:** fixed setting NaN as Content-Length for form payload in some cases; ([#5535](https://github.com/axios/axios/issues/5535)) ([c19f7bf](https://github.com/axios/axios/commit/c19f7bf770f90ae8307f4ea3104f227056912da1)) -* **headers:** fixed the filtering logic of the clear method; ([#5542](https://github.com/axios/axios/issues/5542)) ([ea87ebf](https://github.com/axios/axios/commit/ea87ebfe6d1699af072b9e7cd40faf8f14b0ab93)) +- **formdata:** added a check to make sure the FormData class is available in the browser's global scope; ([#5545](https://github.com/axios/axios/issues/5545)) ([a6dfa72](https://github.com/axios/axios/commit/a6dfa72010db5ad52db8bd13c0f98e537e8fd05d)) +- **formdata:** fixed setting NaN as Content-Length for form payload in some cases; ([#5535](https://github.com/axios/axios/issues/5535)) ([c19f7bf](https://github.com/axios/axios/commit/c19f7bf770f90ae8307f4ea3104f227056912da1)) +- **headers:** fixed the filtering logic of the clear method; ([#5542](https://github.com/axios/axios/issues/5542)) ([ea87ebf](https://github.com/axios/axios/commit/ea87ebfe6d1699af072b9e7cd40faf8f14b0ab93)) ### Contributors to this release @@ -864,7 +825,9 @@ This functionality is considered as a fix. - avatar [陈若枫](https://github.com/ruofee "+2/-2 (#5467 )") ### PRs + - CVE 2023 45857 ( [#6028](https://api.github.com/repos/axios/axios/pulls/6028) ) + ``` ⚠️ Critical vulnerability fix. See https://security.snyk.io/vuln/SNYK-JS-AXIOS-6032459 @@ -872,18 +835,19 @@ This functionality is considered as a fix. ## [1.3.2](https://github.com/axios/axios/compare/v1.3.1...v1.3.2) (2023-02-03) - ### Bug Fixes -* **http:** treat http://localhost as base URL for relative paths to avoid `ERR_INVALID_URL` error; ([#5528](https://github.com/axios/axios/issues/5528)) ([128d56f](https://github.com/axios/axios/commit/128d56f4a0fb8f5f2ed6e0dd80bc9225fee9538c)) -* **http:** use explicit import instead of TextEncoder global; ([#5530](https://github.com/axios/axios/issues/5530)) ([6b3c305](https://github.com/axios/axios/commit/6b3c305fc40c56428e0afabedc6f4d29c2830f6f)) +- **http:** treat http://localhost as base URL for relative paths to avoid `ERR_INVALID_URL` error; ([#5528](https://github.com/axios/axios/issues/5528)) ([128d56f](https://github.com/axios/axios/commit/128d56f4a0fb8f5f2ed6e0dd80bc9225fee9538c)) +- **http:** use explicit import instead of TextEncoder global; ([#5530](https://github.com/axios/axios/issues/5530)) ([6b3c305](https://github.com/axios/axios/commit/6b3c305fc40c56428e0afabedc6f4d29c2830f6f)) ### Contributors to this release - avatar [Dmitriy Mozgovoy](https://github.com/DigitalBrainJS "+2/-1 (#5530 #5528 )") ### PRs + - CVE 2023 45857 ( [#6028](https://api.github.com/repos/axios/axios/pulls/6028) ) + ``` ⚠️ Critical vulnerability fix. See https://security.snyk.io/vuln/SNYK-JS-AXIOS-6032459 @@ -891,18 +855,19 @@ This functionality is considered as a fix. ## [1.3.1](https://github.com/axios/axios/compare/v1.3.0...v1.3.1) (2023-02-01) - ### Bug Fixes -* **formdata:** add hotfix to use the asynchronous API to compute the content-length header value; ([#5521](https://github.com/axios/axios/issues/5521)) ([96d336f](https://github.com/axios/axios/commit/96d336f527619f21da012fe1f117eeb53e5a2120)) -* **serializer:** fixed serialization of array-like objects; ([#5518](https://github.com/axios/axios/issues/5518)) ([08104c0](https://github.com/axios/axios/commit/08104c028c0f9353897b1b6691d74c440fd0c32d)) +- **formdata:** add hotfix to use the asynchronous API to compute the content-length header value; ([#5521](https://github.com/axios/axios/issues/5521)) ([96d336f](https://github.com/axios/axios/commit/96d336f527619f21da012fe1f117eeb53e5a2120)) +- **serializer:** fixed serialization of array-like objects; ([#5518](https://github.com/axios/axios/issues/5518)) ([08104c0](https://github.com/axios/axios/commit/08104c028c0f9353897b1b6691d74c440fd0c32d)) ### Contributors to this release - avatar [Dmitriy Mozgovoy](https://github.com/DigitalBrainJS "+27/-8 (#5521 #5518 )") ### PRs + - CVE 2023 45857 ( [#6028](https://api.github.com/repos/axios/axios/pulls/6028) ) + ``` ⚠️ Critical vulnerability fix. See https://security.snyk.io/vuln/SNYK-JS-AXIOS-6032459 @@ -910,16 +875,14 @@ This functionality is considered as a fix. # [1.3.0](https://github.com/axios/axios/compare/v1.2.6...v1.3.0) (2023-01-31) - ### Bug Fixes -* **headers:** fixed & optimized clear method; ([#5507](https://github.com/axios/axios/issues/5507)) ([9915635](https://github.com/axios/axios/commit/9915635c69d0ab70daca5738488421f67ca60959)) -* **http:** add zlib headers if missing ([#5497](https://github.com/axios/axios/issues/5497)) ([65e8d1e](https://github.com/axios/axios/commit/65e8d1e28ce829f47a837e45129730e541950d3c)) - +- **headers:** fixed & optimized clear method; ([#5507](https://github.com/axios/axios/issues/5507)) ([9915635](https://github.com/axios/axios/commit/9915635c69d0ab70daca5738488421f67ca60959)) +- **http:** add zlib headers if missing ([#5497](https://github.com/axios/axios/issues/5497)) ([65e8d1e](https://github.com/axios/axios/commit/65e8d1e28ce829f47a837e45129730e541950d3c)) ### Features -* **fomdata:** added support for spec-compliant FormData & Blob types; ([#5316](https://github.com/axios/axios/issues/5316)) ([6ac574e](https://github.com/axios/axios/commit/6ac574e00a06731288347acea1e8246091196953)) +- **fomdata:** added support for spec-compliant FormData & Blob types; ([#5316](https://github.com/axios/axios/issues/5316)) ([6ac574e](https://github.com/axios/axios/commit/6ac574e00a06731288347acea1e8246091196953)) ### Contributors to this release @@ -927,7 +890,9 @@ This functionality is considered as a fix. - avatar [ItsNotGoodName](https://github.com/ItsNotGoodName "+43/-2 (#5497 )") ### PRs + - CVE 2023 45857 ( [#6028](https://api.github.com/repos/axios/axios/pulls/6028) ) + ``` ⚠️ Critical vulnerability fix. See https://security.snyk.io/vuln/SNYK-JS-AXIOS-6032459 @@ -935,18 +900,19 @@ This functionality is considered as a fix. ## [1.2.6](https://github.com/axios/axios/compare/v1.2.5...v1.2.6) (2023-01-28) - ### Bug Fixes -* **headers:** added missed Authorization accessor; ([#5502](https://github.com/axios/axios/issues/5502)) ([342c0ba](https://github.com/axios/axios/commit/342c0ba9a16ea50f5ed7d2366c5c1a2c877e3f26)) -* **types:** fixed `CommonRequestHeadersList` & `CommonResponseHeadersList` types to be private in commonJS; ([#5503](https://github.com/axios/axios/issues/5503)) ([5a3d0a3](https://github.com/axios/axios/commit/5a3d0a3234d77361a1bc7cedee2da1e11df08e2c)) +- **headers:** added missed Authorization accessor; ([#5502](https://github.com/axios/axios/issues/5502)) ([342c0ba](https://github.com/axios/axios/commit/342c0ba9a16ea50f5ed7d2366c5c1a2c877e3f26)) +- **types:** fixed `CommonRequestHeadersList` & `CommonResponseHeadersList` types to be private in commonJS; ([#5503](https://github.com/axios/axios/issues/5503)) ([5a3d0a3](https://github.com/axios/axios/commit/5a3d0a3234d77361a1bc7cedee2da1e11df08e2c)) ### Contributors to this release -- ![avatar](https://avatars.githubusercontent.com/u/12586868?v=4&s=16) [Dmitriy Mozgovoy](https://github.com/DigitalBrainJS "+24/-9 (#5503 #5502 )") +- ![avatar](https://avatars.githubusercontent.com/u/12586868?v=4&s=16) [Dmitriy Mozgovoy](https://github.com/DigitalBrainJS "+24/-9 (#5503 #5502 )") ### PRs + - CVE 2023 45857 ( [#6028](https://api.github.com/repos/axios/axios/pulls/6028) ) + ``` ⚠️ Critical vulnerability fix. See https://security.snyk.io/vuln/SNYK-JS-AXIOS-6032459 @@ -954,18 +920,19 @@ This functionality is considered as a fix. ## [1.2.5](https://github.com/axios/axios/compare/v1.2.4...v1.2.5) (2023-01-26) - ### Bug Fixes -* **types:** fixed AxiosHeaders to handle spread syntax by making all methods non-enumerable; ([#5499](https://github.com/axios/axios/issues/5499)) ([580f1e8](https://github.com/axios/axios/commit/580f1e8033a61baa38149d59fd16019de3932c22)) +- **types:** fixed AxiosHeaders to handle spread syntax by making all methods non-enumerable; ([#5499](https://github.com/axios/axios/issues/5499)) ([580f1e8](https://github.com/axios/axios/commit/580f1e8033a61baa38149d59fd16019de3932c22)) ### Contributors to this release -- ![avatar](https://avatars.githubusercontent.com/u/12586868?v=4&s=16) [Dmitriy Mozgovoy](https://github.com/DigitalBrainJS "+82/-54 (#5499 )") -- ![avatar](https://avatars.githubusercontent.com/u/20516159?v=4&s=16) [Elliot Ford](https://github.com/EFord36 "+1/-1 (#5462 )") +- ![avatar](https://avatars.githubusercontent.com/u/12586868?v=4&s=16) [Dmitriy Mozgovoy](https://github.com/DigitalBrainJS "+82/-54 (#5499 )") +- ![avatar](https://avatars.githubusercontent.com/u/20516159?v=4&s=16) [Elliot Ford](https://github.com/EFord36 "+1/-1 (#5462 )") ### PRs + - CVE 2023 45857 ( [#6028](https://api.github.com/repos/axios/axios/pulls/6028) ) + ``` ⚠️ Critical vulnerability fix. See https://security.snyk.io/vuln/SNYK-JS-AXIOS-6032459 @@ -973,19 +940,20 @@ This functionality is considered as a fix. ## [1.2.4](https://github.com/axios/axios/compare/v1.2.3...v1.2.4) (2023-01-22) - ### Bug Fixes -* **types:** renamed `RawAxiosRequestConfig` back to `AxiosRequestConfig`; ([#5486](https://github.com/axios/axios/issues/5486)) ([2a71f49](https://github.com/axios/axios/commit/2a71f49bc6c68495fa419003a3107ed8bd703ad0)) -* **types:** fix `AxiosRequestConfig` generic; ([#5478](https://github.com/axios/axios/issues/5478)) ([9bce81b](https://github.com/axios/axios/commit/186ea062da8b7d578ae78b1a5c220986b9bce81b)) +- **types:** renamed `RawAxiosRequestConfig` back to `AxiosRequestConfig`; ([#5486](https://github.com/axios/axios/issues/5486)) ([2a71f49](https://github.com/axios/axios/commit/2a71f49bc6c68495fa419003a3107ed8bd703ad0)) +- **types:** fix `AxiosRequestConfig` generic; ([#5478](https://github.com/axios/axios/issues/5478)) ([9bce81b](https://github.com/axios/axios/commit/186ea062da8b7d578ae78b1a5c220986b9bce81b)) ### Contributors to this release -- ![avatar](https://avatars.githubusercontent.com/u/12586868?v=4&s=16) [Dmitriy Mozgovoy](https://github.com/DigitalBrainJS "+242/-108 (#5486 #5482 )") -- ![avatar](https://avatars.githubusercontent.com/u/9430821?v=4&s=16) [Daniel Hillmann](https://github.com/hilleer "+1/-1 (#5478 )") +- ![avatar](https://avatars.githubusercontent.com/u/12586868?v=4&s=16) [Dmitriy Mozgovoy](https://github.com/DigitalBrainJS "+242/-108 (#5486 #5482 )") +- ![avatar](https://avatars.githubusercontent.com/u/9430821?v=4&s=16) [Daniel Hillmann](https://github.com/hilleer "+1/-1 (#5478 )") ### PRs + - CVE 2023 45857 ( [#6028](https://api.github.com/repos/axios/axios/pulls/6028) ) + ``` ⚠️ Critical vulnerability fix. See https://security.snyk.io/vuln/SNYK-JS-AXIOS-6032459 @@ -993,17 +961,18 @@ This functionality is considered as a fix. ## [1.2.3](https://github.com/axios/axios/compare/1.2.2...1.2.3) (2023-01-10) - ### Bug Fixes -* **types:** fixed AxiosRequestConfig header interface by refactoring it to RawAxiosRequestConfig; ([#5420](https://github.com/axios/axios/issues/5420)) ([0811963](https://github.com/axios/axios/commit/08119634a22f1d5b19f5c9ea0adccb6d3eebc3bc)) +- **types:** fixed AxiosRequestConfig header interface by refactoring it to RawAxiosRequestConfig; ([#5420](https://github.com/axios/axios/issues/5420)) ([0811963](https://github.com/axios/axios/commit/08119634a22f1d5b19f5c9ea0adccb6d3eebc3bc)) ### Contributors to this release -- ![avatar](https://avatars.githubusercontent.com/u/12586868?v=4&s=16) [Dmitriy Mozgovoy](https://github.com/DigitalBrainJS "+938/-442 (#5456 #5455 #5453 #5451 #5449 #5447 #5446 #5443 #5442 #5439 #5420 )") +- ![avatar](https://avatars.githubusercontent.com/u/12586868?v=4&s=16) [Dmitriy Mozgovoy](https://github.com/DigitalBrainJS "+938/-442 (#5456 #5455 #5453 #5451 #5449 #5447 #5446 #5443 #5442 #5439 #5420 )") ### PRs + - CVE 2023 45857 ( [#6028](https://api.github.com/repos/axios/axios/pulls/6028) ) + ``` ⚠️ Critical vulnerability fix. See https://security.snyk.io/vuln/SNYK-JS-AXIOS-6032459 @@ -1012,6 +981,7 @@ This functionality is considered as a fix. ## [1.2.2] - 2022-12-29 ### Fixed + - fix(ci): fix release script inputs [#5392](https://github.com/axios/axios/pull/5392) - fix(ci): prerelease scipts [#5377](https://github.com/axios/axios/pull/5377) - fix(ci): release scripts [#5376](https://github.com/axios/axios/pull/5376) @@ -1020,6 +990,7 @@ This functionality is considered as a fix. - fix: add missing HttpStatusCode [#5345](https://github.com/axios/axios/pull/5345) ### Chores + - chore(ci): set conventional-changelog header config [#5406](https://github.com/axios/axios/pull/5406) - chore(ci): fix automatic contributors resolving [#5403](https://github.com/axios/axios/pull/5403) - chore(ci): improved logging for the contributors list generator [#5398](https://github.com/axios/axios/pull/5398) @@ -1030,25 +1001,30 @@ This functionality is considered as a fix. - chore(ci): release scripts [#5364](https://github.com/axios/axios/pull/5364) ### Contributors to this release -- ![avatar](https://avatars.githubusercontent.com/u/12586868?v=4&s=16) [Dmitriy Mozgovoy](https://github.com/DigitalBrainJS) -- ![avatar](https://avatars.githubusercontent.com/u/1652293?v=4&s=16) [Winnie](https://github.com/winniehell) + +- ![avatar](https://avatars.githubusercontent.com/u/12586868?v=4&s=16) [Dmitriy Mozgovoy](https://github.com/DigitalBrainJS) +- ![avatar](https://avatars.githubusercontent.com/u/1652293?v=4&s=16) [Winnie](https://github.com/winniehell) ## [1.2.1] - 2022-12-05 ### Changed + - feat(exports): export mergeConfig [#5151](https://github.com/axios/axios/pull/5151) ### Fixed + - fix(CancelledError): include config [#4922](https://github.com/axios/axios/pull/4922) - fix(general): removing multiple/trailing/leading whitespace [#5022](https://github.com/axios/axios/pull/5022) - fix(headers): decompression for responses without Content-Length header [#5306](https://github.com/axios/axios/pull/5306) - fix(webWorker): exception to sending form data in web worker [#5139](https://github.com/axios/axios/pull/5139) ### Refactors + - refactor(types): AxiosProgressEvent.event type to any [#5308](https://github.com/axios/axios/pull/5308) - refactor(types): add missing types for static AxiosError.from method [#4956](https://github.com/axios/axios/pull/4956) ### Chores + - chore(docs): remove README link to non-existent upgrade guide [#5307](https://github.com/axios/axios/pull/5307) - chore(docs): typo in issue template name [#5159](https://github.com/axios/axios/pull/5159) @@ -1064,7 +1040,9 @@ This functionality is considered as a fix. - [Arthur Fiorette](https://github.com/arthurfiorette) ### PRs + - CVE 2023 45857 ( [#6028](https://api.github.com/repos/axios/axios/pulls/6028) ) + ``` ⚠️ Critical vulnerability fix. See https://security.snyk.io/vuln/SNYK-JS-AXIOS-6032459 @@ -1082,11 +1060,12 @@ This functionality is considered as a fix. - fix: improve AxiosHeaders class [#5224](https://github.com/axios/axios/pull/5224) - fix: TypeScript type definitions for commonjs [#5196](https://github.com/axios/axios/pull/5196) - fix: type definition of use method on AxiosInterceptorManager to match the the README [#5071](https://github.com/axios/axios/pull/5071) -- fix: __dirname is not defined in the sandbox [#5269](https://github.com/axios/axios/pull/5269) +- fix: \_\_dirname is not defined in the sandbox [#5269](https://github.com/axios/axios/pull/5269) - fix: AxiosError.toJSON method to avoid circular references [#5247](https://github.com/axios/axios/pull/5247) - fix: Z_BUF_ERROR when content-encoding is set but the response body is empty [#5250](https://github.com/axios/axios/pull/5250) ### Refactors + - refactor: allowing adapters to be loaded by name [#5277](https://github.com/axios/axios/pull/5277) ### Chores @@ -1137,7 +1116,9 @@ This functionality is considered as a fix. - [relbns](https://github.com/relbns) ### PRs + - CVE 2023 45857 ( [#6028](https://api.github.com/repos/axios/axios/pulls/6028) ) + ``` ⚠️ Critical vulnerability fix. See https://security.snyk.io/vuln/SNYK-JS-AXIOS-6032459 @@ -1178,7 +1159,9 @@ This functionality is considered as a fix. - [ChronosMasterOfAllTime](https://github.com/ChronosMasterOfAllTime) ### PRs + - CVE 2023 45857 ( [#6028](https://api.github.com/repos/axios/axios/pulls/6028) ) + ``` ⚠️ Critical vulnerability fix. See https://security.snyk.io/vuln/SNYK-JS-AXIOS-6032459 @@ -1195,7 +1178,9 @@ This functionality is considered as a fix. - [Jason Saayman](https://github.com/jasonsaayman) ### PRs + - CVE 2023 45857 ( [#6028](https://api.github.com/repos/axios/axios/pulls/6028) ) + ``` ⚠️ Critical vulnerability fix. See https://security.snyk.io/vuln/SNYK-JS-AXIOS-6032459 @@ -1212,7 +1197,9 @@ This functionality is considered as a fix. - [Jason Saayman](https://github.com/jasonsaayman) ### PRs + - CVE 2023 45857 ( [#6028](https://api.github.com/repos/axios/axios/pulls/6028) ) + ``` ⚠️ Critical vulnerability fix. See https://security.snyk.io/vuln/SNYK-JS-AXIOS-6032459 @@ -1238,7 +1225,9 @@ This functionality is considered as a fix. - [Richard Kořínek](https://github.com/risa) ### PRs + - CVE 2023 45857 ( [#6028](https://api.github.com/repos/axios/axios/pulls/6028) ) + ``` ⚠️ Critical vulnerability fix. See https://security.snyk.io/vuln/SNYK-JS-AXIOS-6032459 @@ -1293,8 +1282,8 @@ This functionality is considered as a fix. - Updated Docs [#4742](https://github.com/axios/axios/pull/4742) - Refactored Axios to use ES2017 [#4787](https://github.com/axios/axios/pull/4787) - ### Deprecated + - There are multiple deprecations, refactors and fixes provided in this release. Please read through the full release notes to see how this may impact your project and use case. ### Removed @@ -1340,6 +1329,7 @@ This functionality is considered as a fix. - Allow null indexes on formSerializer and paramsSerializer [#4960](https://github.com/axios/axios/pull/4960) ### Chores + - Set permissions for GitHub actions [#4765](https://github.com/axios/axios/pull/4765) - Included githubactions in the dependabot config [#4770](https://github.com/axios/axios/pull/4770) - Included dependency review [#4771](https://github.com/axios/axios/pull/4771) @@ -1423,4 +1413,4 @@ This functionality is considered as a fix. - [Luca Pizzini](https://github.com/lpizzinidev) - [Willian Agostini](https://github.com/WillianAgostini) -- [Huyen Nguyen](https://github.com/huyenltnguyen) \ No newline at end of file +- [Huyen Nguyen](https://github.com/huyenltnguyen) diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md index 7b6b9817..0a6b9812 100644 --- a/CODE_OF_CONDUCT.md +++ b/CODE_OF_CONDUCT.md @@ -8,16 +8,18 @@ We celebrate diversity and inclusivity regardless of age, body size, disability, ## Our Standards Examples of positive behavior include: -* Showing empathy and kindness toward others -* Being respectful of different opinions and experiences -* Accepting feedback gracefully and learning from it -* Taking responsibility for mistakes and offering sincere apologies + +- Showing empathy and kindness toward others +- Being respectful of different opinions and experiences +- Accepting feedback gracefully and learning from it +- Taking responsibility for mistakes and offering sincere apologies Unacceptable behaviors include: -* Use of sexualized language, imagery, or advances -* Personal attacks, trolling, or insulting comments -* Publishing private information (such as email or address) without permission -* Any other conduct that would be considered inappropriate in a professional setting + +- Use of sexualized language, imagery, or advances +- Personal attacks, trolling, or insulting comments +- Publishing private information (such as email or address) without permission +- Any other conduct that would be considered inappropriate in a professional setting ## Enforcement @@ -26,9 +28,9 @@ All complaints will be reviewed promptly and treated confidentially. ## Enforcement Guidelines -1. **Correction** – A private warning and explanation of why the behavior was inappropriate. -2. **Warning** – A clear warning with consequences for continued behavior. -3. **Temporary Ban** – A temporary ban for repeated or severe violations. +1. **Correction** – A private warning and explanation of why the behavior was inappropriate. +2. **Warning** – A clear warning with consequences for continued behavior. +3. **Temporary Ban** – A temporary ban for repeated or severe violations. 4. **Permanent Ban** – A permanent removal for repeated harassment or sustained inappropriate conduct. --- diff --git a/COLLABORATOR_GUIDE.md b/COLLABORATOR_GUIDE.md index 80405e9d..2a1c5f55 100644 --- a/COLLABORATOR_GUIDE.md +++ b/COLLABORATOR_GUIDE.md @@ -2,13 +2,13 @@ As a collaborator, you will be involved with axios with some administrative responsibilities. This guide will help you understand your role and the responsibilities that come with being a collaborator. -1. __Adhere to and help enforce the Code of Conduct.__ It is expected that you have read the [code of conduct](https://github.com/axios/axios/blob/master/CODE_OF_CONDUCT.md) and that you agree to live by it. This community should be friendly and welcoming. +1. **Adhere to and help enforce the Code of Conduct.** It is expected that you have read the [code of conduct](https://github.com/axios/axios/blob/master/CODE_OF_CONDUCT.md) and that you agree to live by it. This community should be friendly and welcoming. -1. __Triage issues.__ As a collaborator, you may help sort through the issues that are reported. Issues vary from bugs, regressions, feature requests, questions, etc. Apply the appropriate label(s) and respond as needed. If it is a legitimate request, please address it, otherwise feel free to close the issue and include a comment with a suggestion on where to find support. If an issue has been inactive for more than a week (i.e., the owner of the issue hasn’t responded to you), close the issue with a note indicating stale issues are closed; it can always be reopened if needed. In the case of issues that require a code change, encourage the owner to submit a PR. For less complex code changes, add a very simple and detailed checklist, apply the “first-timers-only” label, and encourage a newcomer to open source to get involved. +1. **Triage issues.** As a collaborator, you may help sort through the issues that are reported. Issues vary from bugs, regressions, feature requests, questions, etc. Apply the appropriate label(s) and respond as needed. If it is a legitimate request, please address it, otherwise feel free to close the issue and include a comment with a suggestion on where to find support. If an issue has been inactive for more than a week (i.e., the owner of the issue hasn’t responded to you), close the issue with a note indicating stale issues are closed; it can always be reopened if needed. In the case of issues that require a code change, encourage the owner to submit a PR. For less complex code changes, add a very simple and detailed checklist, apply the “first-timers-only” label, and encourage a newcomer to open source to get involved. -1. __Answer questions.__ It is not expected that you provide answers to questions that aren’t relevant, nor do you need to mentor people on how to use JavaScript, etc. If the question is not directly about the module, please close the issue. If the question stems from poor documentation, please update the docs and consider adding a code example. In any event try to be helpful and remember that there’s no such thing as a stupid question. +1. **Answer questions.** It is not expected that you provide answers to questions that aren’t relevant, nor do you need to mentor people on how to use JavaScript, etc. If the question is not directly about the module, please close the issue. If the question stems from poor documentation, please update the docs and consider adding a code example. In any event try to be helpful and remember that there’s no such thing as a stupid question. -1. __Assist with PRs.__ By encouraging contributors to supply a PR for their own issue this is ideally where most of your attention will be focused. Keep a few things in mind as you review PRs. +1. **Assist with PRs.** By encouraging contributors to supply a PR for their own issue this is ideally where most of your attention will be focused. Keep a few things in mind as you review PRs. - When fixing a bug: does the PR adequately solve the problem without introducing any regressions? - When implementing a feature: does the feature fit within the scope of axios? @@ -18,6 +18,6 @@ As a collaborator, you will be involved with axios with some administrative resp - Do the tests and linting pass CI? - Are there tests to validate the changes that have been made? -1. __Fix bugs and implement features.__ When things need to be fixed or implemented, and a PR can’t wait, you may do things yourself. You should still submit a PR yourself and get it checked off by at least one other contributor. Keep the points from number 4 in consideration as you push your code. +1. **Fix bugs and implement features.** When things need to be fixed or implemented, and a PR can’t wait, you may do things yourself. You should still submit a PR yourself and get it checked off by at least one other contributor. Keep the points from number 4 in consideration as you push your code. Thank you again for your help as a collaborator and in making axios community great! If you have any questions or need any assistance, please feel free to contact another collaborator or the owner. diff --git a/ECOSYSTEM.md b/ECOSYSTEM.md index 35244575..6711af5b 100644 --- a/ECOSYSTEM.md +++ b/ECOSYSTEM.md @@ -6,44 +6,44 @@ This is a list of axios related libraries and resources. If you have a suggestio ### General -* [axios-vcr](https://github.com/nettofarah/axios-vcr) - 📼 Record and Replay Axios requests -* [@3846masa/axios-cookiejar-support](https://github.com/3846masa/axios-cookiejar-support) - Add tough-cookie support to axios -* [axios-method-override](https://github.com/jacobbuck/axios-method-override) - Axios http request method override plugin -* [axios-cache-plugin](https://github.com/jin5354/axios-cache-plugin) - Help you cache GET requests when using axios. -* [axios-extensions](https://github.com/kuitos/axios-extensions) - A collection of axios extensions, including throttle and cache GET request plugin. -* [axios-fetch](https://github.com/lifeomic/axios-fetch) - A WebAPI Fetch implementation backed by an Axios client -* [axios-actions](https://github.com/davestewart/axios-actions) - Bundle endpoints as callable, reusable services -* [axios-api-versioning](https://weffe.github.io/axios-api-versioning) - Add easy to manage api versioning to axios -* [axios-data-unpacker](https://github.com/anubhavsrivastava/axios-data-unpacker) - Axios interceptor that unpacks HTTP responses so that you can focus on actual server data. -* [r2curl](https://github.com/uyu423/r2curl) - Extracts the cURL command string from the Axios object. (AxiosResponse, AxiosRequestConfig) -* [axios-endpoints](https://github.com/renancaraujo/axios-endpoints) - Axios endpoints help you to create a more concise endpoint mapping with axios. -* [axios-multi-api](https://github.com/MattCCC/axios-multi-api) - Easy API handling whenever there are many endpoints to add. It helps to make Axios requests in an easy and declarative manner. -* [axios-url-template](https://github.com/rafw87/axios-url-template) - Axios interceptor adding support for URL templates. +- [axios-vcr](https://github.com/nettofarah/axios-vcr) - 📼 Record and Replay Axios requests +- [@3846masa/axios-cookiejar-support](https://github.com/3846masa/axios-cookiejar-support) - Add tough-cookie support to axios +- [axios-method-override](https://github.com/jacobbuck/axios-method-override) - Axios http request method override plugin +- [axios-cache-plugin](https://github.com/jin5354/axios-cache-plugin) - Help you cache GET requests when using axios. +- [axios-extensions](https://github.com/kuitos/axios-extensions) - A collection of axios extensions, including throttle and cache GET request plugin. +- [axios-fetch](https://github.com/lifeomic/axios-fetch) - A WebAPI Fetch implementation backed by an Axios client +- [axios-actions](https://github.com/davestewart/axios-actions) - Bundle endpoints as callable, reusable services +- [axios-api-versioning](https://weffe.github.io/axios-api-versioning) - Add easy to manage api versioning to axios +- [axios-data-unpacker](https://github.com/anubhavsrivastava/axios-data-unpacker) - Axios interceptor that unpacks HTTP responses so that you can focus on actual server data. +- [r2curl](https://github.com/uyu423/r2curl) - Extracts the cURL command string from the Axios object. (AxiosResponse, AxiosRequestConfig) +- [axios-endpoints](https://github.com/renancaraujo/axios-endpoints) - Axios endpoints help you to create a more concise endpoint mapping with axios. +- [axios-multi-api](https://github.com/MattCCC/axios-multi-api) - Easy API handling whenever there are many endpoints to add. It helps to make Axios requests in an easy and declarative manner. +- [axios-url-template](https://github.com/rafw87/axios-url-template) - Axios interceptor adding support for URL templates. ### API clients -* [@hey-api/openapi-ts](https://heyapi.dev/openapi-ts/clients/axios) - The OpenAPI to TypeScript codegen. Generate clients, SDKs, validators, and more. -* [swagger-taxos-codegen](https://github.com/michalzaq12/swagger-taxos-codegen) - Axios based Swagger Codegen (tailored for typescript) -* [zodios](https://www.zodios.org) - Typesafe API client based on axios +- [@hey-api/openapi-ts](https://heyapi.dev/openapi-ts/clients/axios) - The OpenAPI to TypeScript codegen. Generate clients, SDKs, validators, and more. +- [swagger-taxos-codegen](https://github.com/michalzaq12/swagger-taxos-codegen) - Axios based Swagger Codegen (tailored for typescript) +- [zodios](https://www.zodios.org) - Typesafe API client based on axios ### Logging and debugging -* [axios-response-logger](https://github.com/srph/axios-response-logger) - Axios interceptor which logs responses -* [axios-debug-log](https://github.com/Gerhut/axios-debug-log) - Axios interceptor of logging requests & responses by debug. -* [axios-curlirize](https://www.npmjs.com/package/axios-curlirize) - Logs axios requests as curl commands, also adds a property to the response object with the curl command as value. +- [axios-response-logger](https://github.com/srph/axios-response-logger) - Axios interceptor which logs responses +- [axios-debug-log](https://github.com/Gerhut/axios-debug-log) - Axios interceptor of logging requests & responses by debug. +- [axios-curlirize](https://www.npmjs.com/package/axios-curlirize) - Logs axios requests as curl commands, also adds a property to the response object with the curl command as value. ### React and redux -* [axios-hooks](https://github.com/simoneb/axios-hooks) - 🦆 React hooks for axios, with built-in support for server side rendering -* [react-hooks-axios](https://github.com/use-hooks/react-hooks-axios) - Custom React Hooks for Axios.js -* [redux-saga-requests](https://github.com/klis87/redux-saga-requests) - Redux-Saga addon to simplify handling of AJAX requests. -* [redux-axios-middleware](https://github.com/svrcekmichal/redux-axios-middleware) - Redux middleware for fetching data with axios HTTP client -* [@react-cmpt/react-request-hook](https://github.com/react-cmpt/react-request-hook) - A React hook plugin for axios. Lightweight and less change. +- [axios-hooks](https://github.com/simoneb/axios-hooks) - 🦆 React hooks for axios, with built-in support for server side rendering +- [react-hooks-axios](https://github.com/use-hooks/react-hooks-axios) - Custom React Hooks for Axios.js +- [redux-saga-requests](https://github.com/klis87/redux-saga-requests) - Redux-Saga addon to simplify handling of AJAX requests. +- [redux-axios-middleware](https://github.com/svrcekmichal/redux-axios-middleware) - Redux middleware for fetching data with axios HTTP client +- [@react-cmpt/react-request-hook](https://github.com/react-cmpt/react-request-hook) - A React hook plugin for axios. Lightweight and less change. ### Unit testing -* [axiosist](https://github.com/Gerhut/axiosist) - Axios based supertest: convert node.js request handler to axios adapter, used for node.js server unit test. -* [axios-mock-adapter](https://github.com/ctimmerm/axios-mock-adapter) — Axios adapter that allows for easily mocking requests -* [axios-test-instance](https://github.com/remcohaszing/axios-test-instance) — Test NodeJS backends using Axios -* [moxios](https://github.com/axios/moxios) - Mock axios requests for testing -* [mocha-axios](https://github.com/jdrydn/mocha-axios) - Streamlined integration testing with Mocha & Axios +- [axiosist](https://github.com/Gerhut/axiosist) - Axios based supertest: convert node.js request handler to axios adapter, used for node.js server unit test. +- [axios-mock-adapter](https://github.com/ctimmerm/axios-mock-adapter) — Axios adapter that allows for easily mocking requests +- [axios-test-instance](https://github.com/remcohaszing/axios-test-instance) — Test NodeJS backends using Axios +- [moxios](https://github.com/axios/moxios) - Mock axios requests for testing +- [mocha-axios](https://github.com/jdrydn/mocha-axios) - Streamlined integration testing with Mocha & Axios diff --git a/README.md b/README.md index f0d7c266..5923b539 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,3 @@ -

🥇 Gold sponsors

Principal Financial Group

We’re bound by one common purpose: to give you the financial tools, resources and information you ne...

www.principal.com

Buy Instagram Followers Twicsy

Buy real Instagram followers from Twicsy starting at only $2.97. Twicsy has been voted the best site...

twicsy.com

Descope

Hi, we're Descope! We are building something in the authentication space for app developers and...

Website | Docs | Community

@@ -11,7 +10,9 @@
+

+
Axios
@@ -38,79 +39,76 @@ [![Known Vulnerabilities](https://snyk.io/test/npm/axios/badge.svg)](https://snyk.io/test/npm/axios) [![Contributors](https://img.shields.io/github/contributors/axios/axios.svg?style=flat-square)](CONTRIBUTORS.md) - - - ## Table of Contents - - [Features](#features) - - [Browser Support](#browser-support) - - [Installing](#installing) - - [Package manager](#package-manager) - - [CDN](#cdn) - - [Example](#example) - - [Axios API](#axios-api) - - [Request method aliases](#request-method-aliases) - - [Concurrency 👎](#concurrency-deprecated) - - [Creating an instance](#creating-an-instance) - - [Instance methods](#instance-methods) - - [Request Config](#request-config) - - [Response Schema](#response-schema) - - [Config Defaults](#config-defaults) - - [Global axios defaults](#global-axios-defaults) - - [Custom instance defaults](#custom-instance-defaults) - - [Config order of precedence](#config-order-of-precedence) - - [Interceptors](#interceptors) - - [Multiple Interceptors](#multiple-interceptors) - - [Handling Errors](#handling-errors) - - [Handling Timeouts](#handling-timeouts) - - [Cancellation](#cancellation) - - [AbortController](#abortcontroller) - - [CancelToken 👎](#canceltoken-deprecated) - - [Using application/x-www-form-urlencoded format](#using-applicationx-www-form-urlencoded-format) - - [URLSearchParams](#urlsearchparams) - - [Query string](#query-string-older-browsers) - - [🆕 Automatic serialization](#-automatic-serialization-to-urlsearchparams) - - [Using multipart/form-data format](#using-multipartform-data-format) - - [FormData](#formdata) - - [🆕 Automatic serialization](#-automatic-serialization-to-formdata) - - [Files Posting](#files-posting) - - [HTML Form Posting](#-html-form-posting-browser) - - [🆕 Progress capturing](#-progress-capturing) - - [🆕 Rate limiting](#-rate-limiting) - - [🆕 AxiosHeaders](#-axiosheaders) - - [🔥 Fetch adapter](#-fetch-adapter) - - [🔥 Custom fetch](#-custom-fetch) - - [🔥 Using with Tauri](#-using-with-tauri) - - [🔥 Using with SvelteKit](#-using-with-sveltekit-) - - [🔥 HTTP2](#-http2) - - [Semver](#semver) - - [Promises](#promises) - - [TypeScript](#typescript) - - [Resources](#resources) - - [Credits](#credits) - - [License](#license) +- [Features](#features) +- [Browser Support](#browser-support) +- [Installing](#installing) + - [Package manager](#package-manager) + - [CDN](#cdn) +- [Example](#example) +- [Axios API](#axios-api) +- [Request method aliases](#request-method-aliases) +- [Concurrency 👎](#concurrency-deprecated) +- [Creating an instance](#creating-an-instance) +- [Instance methods](#instance-methods) +- [Request Config](#request-config) +- [Response Schema](#response-schema) +- [Config Defaults](#config-defaults) + - [Global axios defaults](#global-axios-defaults) + - [Custom instance defaults](#custom-instance-defaults) + - [Config order of precedence](#config-order-of-precedence) +- [Interceptors](#interceptors) + - [Multiple Interceptors](#multiple-interceptors) +- [Handling Errors](#handling-errors) +- [Handling Timeouts](#handling-timeouts) +- [Cancellation](#cancellation) + - [AbortController](#abortcontroller) + - [CancelToken 👎](#canceltoken-deprecated) +- [Using application/x-www-form-urlencoded format](#using-applicationx-www-form-urlencoded-format) + - [URLSearchParams](#urlsearchparams) + - [Query string](#query-string-older-browsers) + - [🆕 Automatic serialization](#-automatic-serialization-to-urlsearchparams) +- [Using multipart/form-data format](#using-multipartform-data-format) + - [FormData](#formdata) + - [🆕 Automatic serialization](#-automatic-serialization-to-formdata) +- [Files Posting](#files-posting) +- [HTML Form Posting](#-html-form-posting-browser) +- [🆕 Progress capturing](#-progress-capturing) +- [🆕 Rate limiting](#-rate-limiting) +- [🆕 AxiosHeaders](#-axiosheaders) +- [🔥 Fetch adapter](#-fetch-adapter) + - [🔥 Custom fetch](#-custom-fetch) + - [🔥 Using with Tauri](#-using-with-tauri) + - [🔥 Using with SvelteKit](#-using-with-sveltekit-) +- [🔥 HTTP2](#-http2) +- [Semver](#semver) +- [Promises](#promises) +- [TypeScript](#typescript) +- [Resources](#resources) +- [Credits](#credits) +- [License](#license) ## Features -- **Browser Requests:** Make [XMLHttpRequests](https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest) directly from the browser. -- **Node.js Requests:** Make [http](https://nodejs.org/api/http.html) requests from Node.js environments. -- **Promise-based:** Fully supports the [Promise](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise) API for easier asynchronous code. -- **Interceptors:** Intercept requests and responses to add custom logic or transform data. -- **Data Transformation:** Transform request and response data automatically. -- **Request Cancellation:** Cancel requests using built-in mechanisms. -- **Automatic JSON Handling:** Automatically serializes and parses [JSON](https://www.json.org/json-en.html) data. -- **Form Serialization:** 🆕 Automatically serializes data objects to `multipart/form-data` or `x-www-form-urlencoded` formats. +- **Browser Requests:** Make [XMLHttpRequests](https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest) directly from the browser. +- **Node.js Requests:** Make [http](https://nodejs.org/api/http.html) requests from Node.js environments. +- **Promise-based:** Fully supports the [Promise](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise) API for easier asynchronous code. +- **Interceptors:** Intercept requests and responses to add custom logic or transform data. +- **Data Transformation:** Transform request and response data automatically. +- **Request Cancellation:** Cancel requests using built-in mechanisms. +- **Automatic JSON Handling:** Automatically serializes and parses [JSON](https://www.json.org/json-en.html) data. +- **Form Serialization:** 🆕 Automatically serializes data objects to `multipart/form-data` or `x-www-form-urlencoded` formats. - **XSRF Protection:** Client-side support to protect against [Cross-Site Request Forgery](https://en.wikipedia.org/wiki/Cross-site_request_forgery). ## Browser Support -| Chrome | Firefox | Safari | Opera | Edge | -|:------:|:-------:|:------:|:-----:|:----:| +| Chrome | Firefox | Safari | Opera | Edge | +| :------------------------------------------------------------------------------------------------------------: | :---------------------------------------------------------------------------------------------------------------: | :------------------------------------------------------------------------------------------------------------: | :---------------------------------------------------------------------------------------------------------: | :------------------------------------------------------------------------------------------------------: | | ![Chrome browser logo](https://raw.githubusercontent.com/alrra/browser-logos/main/src/chrome/chrome_48x48.png) | ![Firefox browser logo](https://raw.githubusercontent.com/alrra/browser-logos/main/src/firefox/firefox_48x48.png) | ![Safari browser logo](https://raw.githubusercontent.com/alrra/browser-logos/main/src/safari/safari_48x48.png) | ![Opera browser logo](https://raw.githubusercontent.com/alrra/browser-logos/main/src/opera/opera_48x48.png) | ![Edge browser logo](https://raw.githubusercontent.com/alrra/browser-logos/main/src/edge/edge_48x48.png) | -| Latest ✔ | Latest ✔ | Latest ✔ | Latest ✔ | Latest ✔ | +| Latest ✔ | Latest ✔ | Latest ✔ | Latest ✔ | Latest ✔ | [![Browser Matrix](https://saucelabs.com/open_sauce/build_matrix/axios.svg)](https://saucelabs.com/u/axios) @@ -151,36 +149,36 @@ $ bun add axios Once the package is installed, you can import the library using `import` or `require` approach: ```js -import axios, {isCancel, AxiosError} from 'axios'; +import axios, { isCancel, AxiosError } from "axios"; ``` You can also use the default export, since the named export is just a re-export from the Axios factory: ```js -import axios from 'axios'; +import axios from "axios"; -console.log(axios.isCancel('something')); -```` +console.log(axios.isCancel("something")); +``` If you use `require` for importing, **only the default export is available**: ```js -const axios = require('axios'); +const axios = require("axios"); -console.log(axios.isCancel('something')); +console.log(axios.isCancel("something")); ``` For some bundlers and some ES6 linters you may need to do the following: ```js -import { default as axios } from 'axios'; +import { default as axios } from "axios"; ``` For cases where something went wrong when trying to import a module into a custom or legacy environment, you can try importing the module package directly: ```js -const axios = require('axios/dist/browser/axios.cjs'); // browser commonJS bundle (ES2017) +const axios = require("axios/dist/browser/axios.cjs"); // browser commonJS bundle (ES2017) // const axios = require('axios/dist/node/axios.cjs'); // node commonJS bundle (ES2017) ``` @@ -201,21 +199,22 @@ Using unpkg CDN: ## Example ```js -import axios from 'axios'; +import axios from "axios"; //const axios = require('axios'); // legacy way try { - const response = await axios.get('/user?ID=12345'); + const response = await axios.get("/user?ID=12345"); console.log(response); } catch (error) { console.error(error); } // Optionally the request above could also be done as -axios.get('/user', { +axios + .get("/user", { params: { - ID: 12345 - } + ID: 12345, + }, }) .then(function (response) { console.log(response); @@ -230,7 +229,7 @@ axios.get('/user', { // Want to use async/await? Add the `async` keyword to your outer function/method. async function getUser() { try { - const response = await axios.get('/user?ID=12345'); + const response = await axios.get("/user?ID=12345"); console.log(response); } catch (error) { console.error(error); @@ -244,9 +243,9 @@ async function getUser() { Performing a `POST` request ```js -const response = await axios.post('/user', { - firstName: 'Fred', - lastName: 'Flintstone' +const response = await axios.post("/user", { + firstName: "Fred", + lastName: "Flintstone", }); console.log(response); ``` @@ -255,18 +254,17 @@ Performing multiple concurrent requests ```js function getUserAccount() { - return axios.get('/user/12345'); + return axios.get("/user/12345"); } function getUserPermissions() { - return axios.get('/user/12345/permissions'); + return axios.get("/user/12345/permissions"); } -Promise.all([getUserAccount(), getUserPermissions()]) - .then(function (results) { - const acct = results[0]; - const perm = results[1]; - }); +Promise.all([getUserAccount(), getUserPermissions()]).then(function (results) { + const acct = results[0]; + const perm = results[1]; +}); ``` ## axios API @@ -278,30 +276,30 @@ Requests can be made by passing the relevant config to `axios`. ```js // Send a POST request axios({ - method: 'post', - url: '/user/12345', + method: "post", + url: "/user/12345", data: { - firstName: 'Fred', - lastName: 'Flintstone' - } + firstName: "Fred", + lastName: "Flintstone", + }, }); ``` ```js // GET request for remote image in node.js const response = await axios({ - method: 'get', - url: 'https://bit.ly/2mTM3nY', - responseType: 'stream' + method: "get", + url: "https://bit.ly/2mTM3nY", + responseType: "stream", }); -response.data.pipe(fs.createWriteStream('ada_lovelace.jpg')) +response.data.pipe(fs.createWriteStream("ada_lovelace.jpg")); ``` ##### axios(url[, config]) ```js // Send a GET request (default method) -axios('/user/12345'); +axios("/user/12345"); ``` ### Request method aliases @@ -309,18 +307,27 @@ axios('/user/12345'); For convenience, aliases have been provided for all common request methods. ##### axios.request(config) + ##### axios.get(url[, config]) + ##### axios.delete(url[, config]) + ##### axios.head(url[, config]) + ##### axios.options(url[, config]) + ##### axios.post(url[, data[, config]]) + ##### axios.put(url[, data[, config]]) + ##### axios.patch(url[, data[, config]]) ###### NOTE + When using the alias methods `url`, `method`, and `data` properties don't need to be specified in config. ### Concurrency (Deprecated) + Please use `Promise.all` to replace the below functions. Helper functions for dealing with concurrent requests. @@ -336,9 +343,9 @@ You can create a new instance of axios with a custom config. ```js const instance = axios.create({ - baseURL: 'https://some-domain.com/api/', + baseURL: "https://some-domain.com/api/", timeout: 1000, - headers: {'X-Custom-Header': 'foobar'} + headers: { "X-Custom-Header": "foobar" }, }); ``` @@ -347,13 +354,21 @@ const instance = axios.create({ The available instance methods are listed below. The specified config will be merged with the instance config. ##### axios#request(config) + ##### axios#get(url[, config]) + ##### axios#delete(url[, config]) + ##### axios#head(url[, config]) + ##### axios#options(url[, config]) + ##### axios#post(url[, data[, config]]) + ##### axios#put(url[, data[, config]]) + ##### axios#patch(url[, data[, config]]) + ##### axios#getUri([config]) ## Request Config @@ -655,7 +670,7 @@ The response to a request contains the following information. When using `then`, you will receive the response as follows: ```js -const response = await axios.get('/user/12345') +const response = await axios.get("/user/12345"); console.log(response.data); console.log(response.status); console.log(response.statusText); @@ -672,13 +687,14 @@ You can specify config defaults that will be applied to every request. ### Global axios defaults ```js -axios.defaults.baseURL = 'https://api.example.com'; +axios.defaults.baseURL = "https://api.example.com"; // Important: If axios is used with multiple domains, the AUTH_TOKEN will be sent to all of them. // See below for an example using Custom instance defaults instead. -axios.defaults.headers.common['Authorization'] = AUTH_TOKEN; +axios.defaults.headers.common["Authorization"] = AUTH_TOKEN; -axios.defaults.headers.post['Content-Type'] = 'application/x-www-form-urlencoded'; +axios.defaults.headers.post["Content-Type"] = + "application/x-www-form-urlencoded"; ``` ### Custom instance defaults @@ -686,11 +702,11 @@ axios.defaults.headers.post['Content-Type'] = 'application/x-www-form-urlencoded ```js // Set config defaults when creating the instance const instance = axios.create({ - baseURL: 'https://api.example.com' + baseURL: "https://api.example.com", }); // Alter defaults after instance has been created -instance.defaults.headers.common['Authorization'] = AUTH_TOKEN; +instance.defaults.headers.common["Authorization"] = AUTH_TOKEN; ``` ### Config order of precedence @@ -707,8 +723,8 @@ const instance = axios.create(); instance.defaults.timeout = 2500; // Override timeout for this request as it's known to take a long time -instance.get('/longRequest', { - timeout: 5000 +instance.get("/longRequest", { + timeout: 5000, }); ``` @@ -718,44 +734,56 @@ You can intercept requests or responses before methods like `.get()` or `.post() resolve their promises (before code inside `then` or `catch`, or after `await`) ```js - const instance = axios.create(); // Add a request interceptor -instance.interceptors.request.use(function (config) { +instance.interceptors.request.use( + function (config) { // Do something before the request is sent return config; - }, function (error) { + }, + function (error) { // Do something with the request error return Promise.reject(error); - }); + }, +); // Add a response interceptor -instance.interceptors.response.use(function (response) { +instance.interceptors.response.use( + function (response) { // Any status code that lies within the range of 2xx causes this function to trigger // Do something with response data return response; - }, function (error) { + }, + function (error) { // Any status codes that fall outside the range of 2xx cause this function to trigger // Do something with response error return Promise.reject(error); - }); + }, +); ``` If you need to remove an interceptor later you can. ```js const instance = axios.create(); -const myInterceptor = instance.interceptors.request.use(function () {/*...*/}); +const myInterceptor = instance.interceptors.request.use(function () { + /*...*/ +}); axios.interceptors.request.eject(myInterceptor); ``` You can also clear all interceptors for requests or responses. + ```js const instance = axios.create(); -instance.interceptors.request.use(function () {/*...*/}); +instance.interceptors.request.use(function () { + /*...*/ +}); instance.interceptors.request.clear(); // Removes interceptors from requests -instance.interceptors.response.use(function () {/*...*/}); +instance.interceptors.response.use(function () { + /*...*/ +}); instance.interceptors.response.clear(); // Removes interceptors from responses ``` @@ -763,7 +791,9 @@ You can add interceptors to a custom instance of axios. ```js const instance = axios.create(); -instance.interceptors.request.use(function () {/*...*/}); +instance.interceptors.request.use(function () { + /*...*/ +}); ``` When you add request interceptors, they are presumed to be asynchronous by default. This can cause a delay @@ -772,10 +802,14 @@ the interceptor and your request gets put at the bottom of the call stack). If y to the options object that will tell axios to run the code synchronously and avoid any delays in request execution. ```js -axios.interceptors.request.use(function (config) { - config.headers.test = 'I am only a header!'; - return config; -}, null, { synchronous: true }); +axios.interceptors.request.use( + function (config) { + config.headers.test = "I am only a header!"; + return config; + }, + null, + { synchronous: true }, +); ``` If you want to execute a particular interceptor based on a runtime check, @@ -786,12 +820,16 @@ asynchronous request interceptor that only needs to run at certain times. ```js function onGetCall(config) { - return config.method === 'get'; + return config.method === "get"; } -axios.interceptors.request.use(function (config) { - config.headers.test = 'special get headers'; - return config; -}, null, { runWhen: onGetCall }); +axios.interceptors.request.use( + function (config) { + config.headers.test = "special get headers"; + return config; + }, + null, + { runWhen: onGetCall }, +); ``` > **Note:** The options parameter(having `synchronous` and `runWhen` properties) is only supported for request interceptors at the moment. @@ -812,14 +850,14 @@ const instance = axios.create(); const interceptor = (id) => (base) => { console.log(id); return base; -} +}; -instance.interceptors.request.use(interceptor('Request Interceptor 1')); -instance.interceptors.request.use(interceptor('Request Interceptor 2')); -instance.interceptors.request.use(interceptor('Request Interceptor 3')); -instance.interceptors.response.use(interceptor('Response Interceptor 1')); -instance.interceptors.response.use(interceptor('Response Interceptor 2')); -instance.interceptors.response.use(interceptor('Response Interceptor 3')); +instance.interceptors.request.use(interceptor("Request Interceptor 1")); +instance.interceptors.request.use(interceptor("Request Interceptor 2")); +instance.interceptors.request.use(interceptor("Request Interceptor 3")); +instance.interceptors.response.use(interceptor("Response Interceptor 1")); +instance.interceptors.response.use(interceptor("Response Interceptor 2")); +instance.interceptors.response.use(interceptor("Response Interceptor 3")); // Console output: // Request Interceptor 3 @@ -835,14 +873,15 @@ instance.interceptors.response.use(interceptor('Response Interceptor 3')); Given that you add multiple response interceptors and when the response was fulfilled + - then each interceptor is executed - then they are executed in the order they were added - then only the last interceptor's result is returned - then every interceptor receives the result of its predecessor - and when the fulfillment-interceptor throws - - then the following fulfillment-interceptor is not called - - then the following rejection-interceptor is called - - once caught, another following fulfill-interceptor is called again (just like in a promise chain). + - then the following fulfillment-interceptor is not called + - then the following rejection-interceptor is called + - once caught, another following fulfill-interceptor is called again (just like in a promise chain). Read [the interceptor tests](./test/specs/interceptors.spec.js) to see all this in code. @@ -851,19 +890,19 @@ Read [the interceptor tests](./test/specs/interceptors.spec.js) to see all this There are many different axios error messages that can appear which can provide basic information about the specifics of the error and where opportunities may lie in debugging. The general structure of axios errors is as follows: -| Property | Definition | -| -------- | ---------- | -| message | A quick summary of the error message and the status it failed with. | -| name | This defines where the error originated from. For axios, it will always be an 'AxiosError'. | -| stack | Provides the stack trace of the error. | -| config | An axios config object with specific instance configurations defined by the user from when the request was made | -| code | Represents an axios identified error. The table below lists specific definitions for internal axios error. | -| status | HTTP response status code. See [here](https://en.wikipedia.org/wiki/List_of_HTTP_status_codes) for common HTTP response status code meanings. +| Property | Definition | +| -------- | ---------- | +| message | A quick summary of the error message and the status it failed with. | +| name | This defines where the error originated from. For axios, it will always be an 'AxiosError'. | +| stack | Provides the stack trace of the error. | +| config | An axios config object with specific instance configurations defined by the user from when the request was made | +| code | Represents an axios identified error. The table below lists specific definitions for internal axios error. | +| status | HTTP response status code. See [here](https://en.wikipedia.org/wiki/List_of_HTTP_status_codes) for common HTTP response status code meanings. Below is a list of potential axios identified error: | Code | Definition | -| --- | --- | +| ------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | ERR_BAD_OPTION_VALUE | Invalid value provided in axios configuration. | | ERR_BAD_OPTION | Invalid option provided in axios configuration. | | ERR_NOT_SUPPORT | Feature or method not supported in the current axios environment. | @@ -871,55 +910,53 @@ Below is a list of potential axios identified error: | ERR_INVALID_URL | Invalid URL provided for axios request. | | ECONNABORTED | Typically indicates that the request has been timed out (unless `transitional.clarifyTimeoutError` is set) or aborted by the browser or its plugin. | | ERR_CANCELED | Feature or method is canceled explicitly by the user using an AbortSignal (or a CancelToken). | -| ETIMEDOUT | Request timed out due to exceeding the default axios timelimit. `transitional.clarifyTimeoutError` must be set to `true`, otherwise a generic `ECONNABORTED` error will be thrown instead. | +| ETIMEDOUT | Request timed out due to exceeding the default axios timelimit. `transitional.clarifyTimeoutError` must be set to `true`, otherwise a generic `ECONNABORTED` error will be thrown instead. | | ERR_NETWORK | Network-related issue. In the browser, this error can also be caused by a [CORS](https://developer.mozilla.org/ru/docs/Web/HTTP/Guides/CORS) or [Mixed Content](https://developer.mozilla.org/en-US/docs/Web/Security/Mixed_content) policy violation. The browser does not allow the JS code to clarify the real reason for the error caused by security issues, so please check the console. | | ERR_FR_TOO_MANY_REDIRECTS | Request is redirected too many times; exceeds max redirects specified in axios configuration. | -| ERR_BAD_RESPONSE | Response cannot be parsed properly or is in an unexpected format. Usually related to a response with `5xx` status code. | -| ERR_BAD_REQUEST | The request has an unexpected format or is missing required parameters. Usually related to a response with `4xx` status code. | +| ERR_BAD_RESPONSE | Response cannot be parsed properly or is in an unexpected format. Usually related to a response with `5xx` status code. | +| ERR_BAD_REQUEST | The request has an unexpected format or is missing required parameters. Usually related to a response with `4xx` status code. | ## Handling Errors The default behavior is to reject every response that returns with a status code that falls out of the range of 2xx and treat it as an error. ```js -axios.get('/user/12345') - .catch(function (error) { - if (error.response) { - // The request was made and the server responded with a status code - // that falls out of the range of 2xx - console.log(error.response.data); - console.log(error.response.status); - console.log(error.response.headers); - } else if (error.request) { - // The request was made but no response was received - // `error.request` is an instance of XMLHttpRequest in the browser and an instance of - // http.ClientRequest in node.js - console.log(error.request); - } else { - // Something happened in setting up the request that triggered an Error - console.log('Error', error.message); - } - console.log(error.config); - }); +axios.get("/user/12345").catch(function (error) { + if (error.response) { + // The request was made and the server responded with a status code + // that falls out of the range of 2xx + console.log(error.response.data); + console.log(error.response.status); + console.log(error.response.headers); + } else if (error.request) { + // The request was made but no response was received + // `error.request` is an instance of XMLHttpRequest in the browser and an instance of + // http.ClientRequest in node.js + console.log(error.request); + } else { + // Something happened in setting up the request that triggered an Error + console.log("Error", error.message); + } + console.log(error.config); +}); ``` Using the `validateStatus` config option, you can override the default condition (status >= 200 && status < 300) and define HTTP code(s) that should throw an error. ```js -axios.get('/user/12345', { +axios.get("/user/12345", { validateStatus: function (status) { return status < 500; // Resolve only if the status code is less than 500 - } -}) + }, +}); ``` Using `toJSON` you get an object with more information about the HTTP error. ```js -axios.get('/user/12345') - .catch(function (error) { - console.log(error.toJSON()); - }); +axios.get("/user/12345").catch(function (error) { + console.log(error.toJSON()); +}); ``` ## Handling Timeouts @@ -927,17 +964,16 @@ axios.get('/user/12345') ```js async function fetchWithTimeout() { try { - const response = await axios.get('https://example.com/data', { - timeout: 5000 // 5 seconds + const response = await axios.get("https://example.com/data", { + timeout: 5000, // 5 seconds }); - console.log('Response:', response.data); - + console.log("Response:", response.data); } catch (error) { - if (axios.isAxiosError(error) && error.code === 'ECONNABORTED') { - console.error('❌ Request timed out!'); + if (axios.isAxiosError(error) && error.code === "ECONNABORTED") { + console.error("❌ Request timed out!"); } else { - console.error('❌ Error:', error.message); + console.error("❌ Error:", error.message); } } } @@ -952,18 +988,20 @@ Starting from `v0.22.0` Axios supports AbortController to cancel requests in a f ```js const controller = new AbortController(); -axios.get('/foo/bar', { - signal: controller.signal -}).then(function(response) { - //... -}); +axios + .get("/foo/bar", { + signal: controller.signal, + }) + .then(function (response) { + //... + }); // cancel the request -controller.abort() +controller.abort(); ``` ### CancelToken `👎deprecated` -You can also cancel a request using a *CancelToken*. +You can also cancel a request using a _CancelToken_. > The axios cancel token API is based on the withdrawn [cancellable promises proposal](https://github.com/tc39/proposal-cancelable-promises). @@ -975,24 +1013,30 @@ You can create a cancel token using the `CancelToken.source` factory as shown be const CancelToken = axios.CancelToken; const source = CancelToken.source(); -axios.get('/user/12345', { - cancelToken: source.token -}).catch(function (thrown) { - if (axios.isCancel(thrown)) { - console.log('Request canceled', thrown.message); - } else { - // handle error - } -}); +axios + .get("/user/12345", { + cancelToken: source.token, + }) + .catch(function (thrown) { + if (axios.isCancel(thrown)) { + console.log("Request canceled", thrown.message); + } else { + // handle error + } + }); -axios.post('/user/12345', { - name: 'new name' -}, { - cancelToken: source.token -}) +axios.post( + "/user/12345", + { + name: "new name", + }, + { + cancelToken: source.token, + }, +); // cancel the request (the message parameter is optional) -source.cancel('Operation canceled by the user.'); +source.cancel("Operation canceled by the user."); ``` You can also create a cancel token by passing an executor function to the `CancelToken` constructor: @@ -1001,11 +1045,11 @@ You can also create a cancel token by passing an executor function to the `Cance const CancelToken = axios.CancelToken; let cancel; -axios.get('/user/12345', { +axios.get("/user/12345", { cancelToken: new CancelToken(function executor(c) { // An executor function receives a cancel function as a parameter cancel = c; - }) + }), }); // cancel the request @@ -1024,9 +1068,9 @@ cancel(); By default, axios serializes JavaScript objects to `JSON`. To send data in the [`application/x-www-form-urlencoded` format](https://developer.mozilla.org/en-US/docs/Web/HTTP/Methods/POST) instead, you can use the [`URLSearchParams`](https://developer.mozilla.org/en-US/docs/Web/API/URLSearchParams) API, which is [supported](http://www.caniuse.com/#feat=urlsearchparams) in the vast majority of browsers,and [ Node](https://nodejs.org/api/url.html#url_class_urlsearchparams) starting with v10 (released in 2018). ```js -const params = new URLSearchParams({ foo: 'bar' }); -params.append('extraparam', 'value'); -axios.post('/foo', params); +const params = new URLSearchParams({ foo: "bar" }); +params.append("extraparam", "value"); +axios.post("/foo", params); ``` ### Query string (Older browsers) @@ -1036,18 +1080,18 @@ For compatibility with very old browsers, there is a [polyfill](https://github.c Alternatively, you can encode data using the [`qs`](https://github.com/ljharb/qs) library: ```js -const qs = require('qs'); -axios.post('/foo', qs.stringify({ 'bar': 123 })); +const qs = require("qs"); +axios.post("/foo", qs.stringify({ bar: 123 })); ``` Or in another way (ES6), ```js -import qs from 'qs'; -const data = { 'bar': 123 }; +import qs from "qs"; +const data = { bar: 123 }; const options = { - method: 'POST', - headers: { 'content-type': 'application/x-www-form-urlencoded' }, + method: "POST", + headers: { "content-type": "application/x-www-form-urlencoded" }, data: qs.stringify(data), url, }; @@ -1059,8 +1103,8 @@ axios(options); For older Node.js engines, you can use the [`querystring`](https://nodejs.org/api/querystring.html) module as follows: ```js -const querystring = require('querystring'); -axios.post('https://something.com/', querystring.stringify({ foo: 'bar' })); +const querystring = require("querystring"); +axios.post("https://something.com/", querystring.stringify({ foo: "bar" })); ``` You can also use the [`qs`](https://github.com/ljharb/qs) library. @@ -1076,12 +1120,15 @@ const data = { x: 1, arr: [1, 2, 3], arr2: [1, [2], 3], - users: [{name: 'Peter', surname: 'Griffin'}, {name: 'Thomas', surname: 'Anderson'}], + users: [ + { name: "Peter", surname: "Griffin" }, + { name: "Thomas", surname: "Anderson" }, + ], }; -await axios.postForm('https://postman-echo.com/post', data, - {headers: {'content-type': 'application/x-www-form-urlencoded'}} -); +await axios.postForm("https://postman-echo.com/post", data, { + headers: { "content-type": "application/x-www-form-urlencoded" }, +}); ``` The server will handle it as: @@ -1099,21 +1146,21 @@ The server will handle it as: 'users[1][name]': 'Thomas', 'users[1][surname]': 'Anderson' } -```` +``` If your backend body-parser (like `body-parser` of `express.js`) supports nested objects decoding, you will get the same object on the server-side automatically ```js - const app = express(); +const app = express(); - app.use(bodyParser.urlencoded({ extended: true })); // support encoded bodies +app.use(bodyParser.urlencoded({ extended: true })); // support encoded bodies - app.post('/', function (req, res, next) { - // echo body as JSON - res.send(JSON.stringify(req.body)); - }); +app.post("/", function (req, res, next) { + // echo body as JSON + res.send(JSON.stringify(req.body)); +}); - server = app.listen(3000); +server = app.listen(3000); ``` ## Using `multipart/form-data` format @@ -1125,22 +1172,22 @@ Setting the `Content-Type` header is not required as Axios guesses it based on t ```js const formData = new FormData(); -formData.append('foo', 'bar'); +formData.append("foo", "bar"); -axios.post('https://httpbin.org/post', formData); +axios.post("https://httpbin.org/post", formData); ``` In node.js, you can use the [`form-data`](https://github.com/form-data/form-data) library as follows: ```js -const FormData = require('form-data'); +const FormData = require("form-data"); const form = new FormData(); -form.append('my_field', 'my value'); -form.append('my_buffer', new Buffer(10)); -form.append('my_file', fs.createReadStream('/foo/bar.jpg')); +form.append("my_field", "my value"); +form.append("my_buffer", new Buffer(10)); +form.append("my_file", fs.createReadStream("/foo/bar.jpg")); -axios.post('https://example.com', form) +axios.post("https://example.com", form); ``` ### 🆕 Automatic serialization to FormData @@ -1151,13 +1198,19 @@ header is set to `multipart/form-data`. The following request will submit the data in a FormData format (Browser & Node.js): ```js -import axios from 'axios'; +import axios from "axios"; -axios.post('https://httpbin.org/post', {x: 1}, { - headers: { - 'Content-Type': 'multipart/form-data' - } -}).then(({data}) => console.log(data)); +axios + .post( + "https://httpbin.org/post", + { x: 1 }, + { + headers: { + "Content-Type": "multipart/form-data", + }, + }, + ) + .then(({ data }) => console.log(data)); ``` In the `node.js` build, the ([`form-data`](https://github.com/form-data/form-data)) polyfill is used by default. @@ -1166,14 +1219,20 @@ You can overload the FormData class by setting the `env.FormData` config variabl but you probably won't need it in most cases: ```js -const axios = require('axios'); -var FormData = require('form-data'); +const axios = require("axios"); +var FormData = require("form-data"); -axios.post('https://httpbin.org/post', {x: 1, buf: new Buffer(10)}, { - headers: { - 'Content-Type': 'multipart/form-data' - } -}).then(({data}) => console.log(data)); +axios + .post( + "https://httpbin.org/post", + { x: 1, buf: new Buffer(10) }, + { + headers: { + "Content-Type": "multipart/form-data", + }, + }, + ) + .then(({ data }) => console.log(data)); ``` Axios FormData serializer supports some special endings to perform the following operations: @@ -1186,18 +1245,17 @@ Axios FormData serializer supports some special endings to perform the following FormData serializer supports additional options via `config.formSerializer: object` property to handle rare cases: - `visitor: Function` - user-defined visitor function that will be called recursively to serialize the data object -to a `FormData` object by following custom rules. + to a `FormData` object by following custom rules. - `dots: boolean = false` - use dot notation instead of brackets to serialize arrays and objects; - `metaTokens: boolean = true` - add the special ending (e.g `user{}: '{"name": "John"}'`) in the FormData key. -The back-end body-parser could potentially use this meta-information to automatically parse the value as JSON. + The back-end body-parser could potentially use this meta-information to automatically parse the value as JSON. - `indexes: null|false|true = false` - controls how indexes will be added to unwrapped keys of `flat` array-like objects. - - - `null` - don't add brackets (`arr: 1`, `arr: 2`, `arr: 3`) - - `false`(default) - add empty brackets (`arr[]: 1`, `arr[]: 2`, `arr[]: 3`) - - `true` - add brackets with indexes (`arr[0]: 1`, `arr[1]: 2`, `arr[2]: 3`) + - `null` - don't add brackets (`arr: 1`, `arr: 2`, `arr: 3`) + - `false`(default) - add empty brackets (`arr[]: 1`, `arr[]: 2`, `arr[]: 3`) + - `true` - add brackets with indexes (`arr[0]: 1`, `arr[1]: 2`, `arr[2]: 3`) Let's say we have an object like this one: @@ -1206,8 +1264,11 @@ const obj = { x: 1, arr: [1, 2, 3], arr2: [1, [2], 3], - users: [{name: 'Peter', surname: 'Griffin'}, {name: 'Thomas', surname: 'Anderson'}], - 'obj2{}': [{x:1}] + users: [ + { name: "Peter", surname: "Griffin" }, + { name: "Thomas", surname: "Anderson" }, + ], + "obj2{}": [{ x: 1 }], }; ``` @@ -1215,18 +1276,18 @@ The following steps will be executed by the Axios serializer internally: ```js const formData = new FormData(); -formData.append('x', '1'); -formData.append('arr[]', '1'); -formData.append('arr[]', '2'); -formData.append('arr[]', '3'); -formData.append('arr2[0]', '1'); -formData.append('arr2[1][0]', '2'); -formData.append('arr2[2]', '3'); -formData.append('users[0][name]', 'Peter'); -formData.append('users[0][surname]', 'Griffin'); -formData.append('users[1][name]', 'Thomas'); -formData.append('users[1][surname]', 'Anderson'); -formData.append('obj2{}', '[{"x":1}]'); +formData.append("x", "1"); +formData.append("arr[]", "1"); +formData.append("arr[]", "2"); +formData.append("arr[]", "3"); +formData.append("arr2[0]", "1"); +formData.append("arr2[1][0]", "2"); +formData.append("arr2[2]", "3"); +formData.append("users[0][name]", "Peter"); +formData.append("users[0][surname]", "Griffin"); +formData.append("users[1][name]", "Thomas"); +formData.append("users[1][surname]", "Anderson"); +formData.append("obj2{}", '[{"x":1}]'); ``` Axios supports the following shortcut methods: `postForm`, `putForm`, `patchForm` @@ -1237,24 +1298,27 @@ which are just the corresponding http methods with the `Content-Type` header pre You can easily submit a single file: ```js -await axios.postForm('https://httpbin.org/post', { - 'myVar' : 'foo', - 'file': document.querySelector('#fileInput').files[0] +await axios.postForm("https://httpbin.org/post", { + myVar: "foo", + file: document.querySelector("#fileInput").files[0], }); ``` or multiple files as `multipart/form-data`: ```js -await axios.postForm('https://httpbin.org/post', { - 'files[]': document.querySelector('#fileInput').files +await axios.postForm("https://httpbin.org/post", { + "files[]": document.querySelector("#fileInput").files, }); ``` `FileList` object can be passed directly: ```js -await axios.postForm('https://httpbin.org/post', document.querySelector('#fileInput').files) +await axios.postForm( + "https://httpbin.org/post", + document.querySelector("#fileInput").files, +); ``` All files will be sent with the same field names: `files[]`. @@ -1264,28 +1328,35 @@ All files will be sent with the same field names: `files[]`. Pass an HTML Form element as a payload to submit it as `multipart/form-data` content. ```js -await axios.postForm('https://httpbin.org/post', document.querySelector('#htmlForm')); +await axios.postForm( + "https://httpbin.org/post", + document.querySelector("#htmlForm"), +); ``` `FormData` and `HTMLForm` objects can also be posted as `JSON` by explicitly setting the `Content-Type` header to `application/json`: ```js -await axios.post('https://httpbin.org/post', document.querySelector('#htmlForm'), { - headers: { - 'Content-Type': 'application/json' - } -}) +await axios.post( + "https://httpbin.org/post", + document.querySelector("#htmlForm"), + { + headers: { + "Content-Type": "application/json", + }, + }, +); ``` For example, the Form ```html
- - - - - + + + + + - +
``` @@ -1315,7 +1386,7 @@ will be submitted as the following JSON object: "age": "value2" } } -```` +``` Sending `Blobs`/`Files` as JSON (`base64`) is not currently supported. @@ -1348,25 +1419,25 @@ await axios.post(url, data, { rate?: number; // download speed in bytes download: true; // download sign }*/ - } + }, }); ``` You can also track stream upload/download progress in node.js: ```js -const {data} = await axios.post(SERVER_URL, readableStream, { - onUploadProgress: ({progress}) => { - console.log((progress * 100).toFixed(2)); - }, +const { data } = await axios.post(SERVER_URL, readableStream, { + onUploadProgress: ({ progress }) => { + console.log((progress * 100).toFixed(2)); + }, - headers: { - 'Content-Length': contentLength - }, + headers: { + "Content-Length": contentLength, + }, - maxRedirects: 0 // avoid buffering the entire stream + maxRedirects: 0, // avoid buffering the entire stream }); -```` +``` > **Note:** > Capturing FormData upload progress is not currently supported in node.js environments. @@ -1375,15 +1446,16 @@ const {data} = await axios.post(SERVER_URL, readableStream, { > It is recommended to disable redirects by setting maxRedirects: 0 to upload the stream in the **node.js** environment, > as the follow-redirects package will buffer the entire stream in RAM without following the "backpressure" algorithm. - ## 🆕 Rate limiting Download and upload rate limits can only be set for the http adapter (node.js): ```js -const {data} = await axios.post(LOCAL_SERVER_URL, myBuffer, { - onUploadProgress: ({progress, rate}) => { - console.log(`Upload [${(progress*100).toFixed(2)}%]: ${(rate / 1024).toFixed(2)}KB/s`) +const { data } = await axios.post(LOCAL_SERVER_URL, myBuffer, { + onUploadProgress: ({ progress, rate }) => { + console.log( + `Upload [${(progress * 100).toFixed(2)}%]: ${(rate / 1024).toFixed(2)}KB/s`, + ); }, maxRate: [100 * 1024], // 100KB/s limit @@ -1405,6 +1477,7 @@ The final headers object with string values is obtained by Axios by calling the > Note: By JSON here we mean an object consisting only of string values intended to be sent over the network. The header value can be one of the following types: + - `string` - normal string value that will be sent to the server - `null` - skip header when rendering to JSON - `false` - skip header when rendering to JSON, additionally indicates that `set` method must be called with `rewrite` option set to `true` @@ -1416,42 +1489,41 @@ The header value can be one of the following types: The headers object is always initialized inside interceptors and transformers: ```ts - axios.interceptors.request.use((request: InternalAxiosRequestConfig) => { - request.headers.set('My-header', 'value'); +axios.interceptors.request.use((request: InternalAxiosRequestConfig) => { + request.headers.set("My-header", "value"); - request.headers.set({ - "My-set-header1": "my-set-value1", - "My-set-header2": "my-set-value2" - }); + request.headers.set({ + "My-set-header1": "my-set-value1", + "My-set-header2": "my-set-value2", + }); - request.headers.set('User-Agent', false); // disable subsequent setting the header by Axios + request.headers.set("User-Agent", false); // disable subsequent setting the header by Axios - request.headers.setContentType('text/plain'); + request.headers.setContentType("text/plain"); - request.headers['My-set-header2'] = 'newValue' // direct access is deprecated + request.headers["My-set-header2"] = "newValue"; // direct access is deprecated - return request; - } - ); -```` + return request; +}); +``` You can iterate over an `AxiosHeaders` instance using a `for...of` statement: -````js +```js const headers = new AxiosHeaders({ - foo: '1', - bar: '2', - baz: '3' + foo: "1", + bar: "2", + baz: "3", }); -for(const [header, value] of headers) { +for (const [header, value] of headers) { console.log(header, value); } // foo 1 // bar 2 // baz 3 -```` +``` ### new AxiosHeaders(headers?) @@ -1463,7 +1535,7 @@ constructor(headers?: RawAxiosHeaders | AxiosHeaders | string); If the headers object is a string, it will be parsed as RAW HTTP headers. -````js +```js const headers = new AxiosHeaders(` Host: www.bing.com User-Agent: curl/7.54.0 @@ -1476,7 +1548,7 @@ console.log(headers); // 'user-agent': 'curl/7.54.0', // accept: '*/*' // } -```` +``` ### AxiosHeaders#set @@ -1487,6 +1559,7 @@ set(headers?: RawAxiosHeaders | AxiosHeaders | string, rewrite?: boolean); ``` The `rewrite` argument controls the overwriting behavior: + - `false` - do not overwrite if the header's value is set (is not `undefined`) - `undefined` (default) - overwrite the header unless its value is set to `false` - `true` - rewrite anyway @@ -1500,34 +1573,34 @@ Returns `this`. ``` get(headerName: string, matcher?: true | AxiosHeaderMatcher): AxiosHeaderValue; get(headerName: string, parser: RegExp): RegExpExecArray | null; -```` +``` Returns the internal value of the header. It can take an extra argument to parse the header's value with `RegExp.exec`, matcher function or internal key-value parser. ```ts const headers = new AxiosHeaders({ - 'Content-Type': 'multipart/form-data; boundary=Asrf456BGe4h' + "Content-Type": "multipart/form-data; boundary=Asrf456BGe4h", }); -console.log(headers.get('Content-Type')); +console.log(headers.get("Content-Type")); // multipart/form-data; boundary=Asrf456BGe4h -console.log(headers.get('Content-Type', true)); // parse key-value pairs from a string separated with \s,;= delimiters: +console.log(headers.get("Content-Type", true)); // parse key-value pairs from a string separated with \s,;= delimiters: // [Object: null prototype] { // 'multipart/form-data': undefined, // boundary: 'Asrf456BGe4h' // } - -console.log(headers.get('Content-Type', (value, name, headers) => { - return String(value).replace(/a/g, 'ZZZ'); -})); +console.log( + headers.get("Content-Type", (value, name, headers) => { + return String(value).replace(/a/g, "ZZZ"); + }), +); // multipZZZrt/form-dZZZtZZZ; boundZZZry=Asrf456BGe4h -console.log(headers.get('Content-Type', /boundary=(\w+)/)?.[0]); +console.log(headers.get("Content-Type", /boundary=(\w+)/)?.[0]); // boundary=Asrf456BGe4h - ``` Returns the value of the header. @@ -1559,9 +1632,9 @@ Unlike the `delete` method matcher, this optional matcher will be used to match ```ts const headers = new AxiosHeaders({ - 'foo': '1', - 'x-foo': '2', - 'x-bar': '3', + foo: "1", + "x-foo": "2", + "x-bar": "3", }); console.log(headers.clear(/^x-/)); // true @@ -1580,11 +1653,11 @@ Set `format` to true for converting header names to lowercase and capitalizing t ```js const headers = new AxiosHeaders({ - 'foo': '1', + foo: "1", }); -headers.Foo = '2'; -headers.FOO = '3'; +headers.Foo = "2"; +headers.FOO = "3"; console.log(headers.toJSON()); // [Object: null prototype] { foo: '1', Foo: '2', FOO: '3' } console.log(headers.normalize().toJSON()); // [Object: null prototype] { foo: '3' } @@ -1605,27 +1678,27 @@ Returns a new `AxiosHeaders` instance. ### AxiosHeaders#toJSON(asStrings?) -```` +``` toJSON(asStrings?: boolean): RawAxiosHeaders; -```` +``` Resolve all internal header values into a new null prototype object. Set `asStrings` to true to resolve arrays as a string containing all elements, separated by commas. ### AxiosHeaders.from(thing?) -```` +``` from(thing?: AxiosHeaders | RawAxiosHeaders | string): AxiosHeaders; -```` +``` Returns a new `AxiosHeaders` instance created from the raw headers passed in, or simply returns the given headers object if it's an `AxiosHeaders` instance. ### AxiosHeaders.concat(...targets) -```` +``` concat(...targets: Array): AxiosHeaders; -```` +``` Returns a new `AxiosHeaders` instance created by merging the target objects. @@ -1650,19 +1723,19 @@ or not supported by the environment. To use it by default, it must be selected explicitly: ```js -const {data} = axios.get(url, { - adapter: 'fetch' // by default ['xhr', 'http', 'fetch'] -}) +const { data } = axios.get(url, { + adapter: "fetch", // by default ['xhr', 'http', 'fetch'] +}); ``` You can create a separate instance for this: ```js const fetchAxios = axios.create({ - adapter: 'fetch' + adapter: "fetch", }); -const {data} = fetchAxios.get(url); +const { data } = fetchAxios.get(url); ``` The adapter supports the same functionality as the `xhr` adapter, **including upload and download progress capturing**. @@ -1683,18 +1756,18 @@ you must disable their use inside the fetch adapter by passing null. Basic example: ```js -import customFetchFunction from 'customFetchModule'; +import customFetchFunction from "customFetchModule"; const instance = axios.create({ - adapter: 'fetch', + adapter: "fetch", onDownloadProgress(e) { - console.log('downloadProgress', e); + console.log("downloadProgress", e); }, env: { fetch: customFetchFunction, Request: null, // undefined -> use the global constructor - Response: null - } + Response: null, + }, }); ``` @@ -1707,16 +1780,16 @@ import { fetch } from "@tauri-apps/plugin-http"; import axios from "axios"; const instance = axios.create({ - adapter: 'fetch', + adapter: "fetch", onDownloadProgress(e) { - console.log('downloadProgress', e); + console.log("downloadProgress", e); }, env: { - fetch - } + fetch, + }, }); - const {data} = await instance.get("https://google.com"); +const { data } = await instance.get("https://google.com"); ``` #### 🔥 Using with SvelteKit @@ -1726,14 +1799,17 @@ which makes it incompatible with the standard URL API. So, Axios must be configu ```js export async function load({ fetch }) { - const {data: post} = await axios.get('https://jsonplaceholder.typicode.com/posts/1', { - adapter: 'fetch', - env: { - fetch, - Request: null, - Response: null - } - }); + const { data: post } = await axios.get( + "https://jsonplaceholder.typicode.com/posts/1", + { + adapter: "fetch", + env: { + fetch, + Request: null, + Response: null, + }, + }, + ); return { post }; } @@ -1741,7 +1817,7 @@ export async function load({ fetch }) { ## 🔥 HTTP2 -In version `1.13.0`, experimental `HTTP2` support was added to the `http` adapter. +In version `1.13.0`, experimental `HTTP2` support was added to the `http` adapter. The `httpVersion` option is now available to select the protocol version used. Additional native options for the internal `session.request()` call can be passed via the `http2Options` config. This config also includes the custom `sessionTimeout` parameter, which defaults to `1000ms`. @@ -1749,22 +1825,26 @@ This config also includes the custom `sessionTimeout` parameter, which defaults ```js const form = new FormData(); - form.append('foo', '123'); +form.append("foo", "123"); - const {data, headers, status} = await axios.post('https://httpbin.org/post', form, { - httpVersion: 2, - http2Options: { - // rejectUnauthorized: false, - // sessionTimeout: 1000 - }, - onUploadProgress(e) { - console.log('upload progress', e); - }, - onDownloadProgress(e) { - console.log('download progress', e); - }, - responseType: 'arraybuffer' - }); +const { data, headers, status } = await axios.post( + "https://httpbin.org/post", + form, + { + httpVersion: 2, + http2Options: { + // rejectUnauthorized: false, + // sessionTimeout: 1000 + }, + onUploadProgress(e) { + console.log("upload progress", e); + }, + onDownloadProgress(e) { + console.log("download progress", e); + }, + responseType: "arraybuffer", + }, +); ``` ## Semver @@ -1783,7 +1863,7 @@ axios includes [TypeScript](https://typescriptlang.org) definitions and a type g ```typescript let user: User = null; try { - const { data } = await axios.get('/user?ID=12345'); + const { data } = await axios.get("/user?ID=12345"); user = data.userDetails; } catch (error) { if (axios.isAxiosError(error)) { @@ -1800,23 +1880,20 @@ If use ESM, your settings should be fine. If you compile TypeScript to CJS and you can’t use `"moduleResolution": "node 16"`, you have to enable `esModuleInterop`. If you use TypeScript to type check CJS JavaScript code, your only option is to use `"moduleResolution": "node16"`. - You can also create a custom instance with typed interceptors: ```typescript -import axios, { AxiosInstance, InternalAxiosRequestConfig } from 'axios'; +import axios, { AxiosInstance, InternalAxiosRequestConfig } from "axios"; const apiClient: AxiosInstance = axios.create({ - baseURL: 'https://api.example.com', + baseURL: "https://api.example.com", timeout: 10000, }); -apiClient.interceptors.request.use( - (config: InternalAxiosRequestConfig) => { - // Add auth token - return config; - } -); +apiClient.interceptors.request.use((config: InternalAxiosRequestConfig) => { + // Add auth token + return config; +}); ``` ## Online one-click setup @@ -1825,13 +1902,12 @@ You can use Gitpod, an online IDE(which is free for Open Source) for contributin [![Open in Gitpod](https://gitpod.io/button/open-in-gitpod.svg)](https://gitpod.io/#https://github.com/axios/axios/blob/main/examples/server.js) - ## Resources -* [Changelog](https://github.com/axios/axios/blob/v1.x/CHANGELOG.md) -* [Ecosystem](https://github.com/axios/axios/blob/v1.x/ECOSYSTEM.md) -* [Contributing Guide](https://github.com/axios/axios/blob/v1.x/CONTRIBUTING.md) -* [Code of Conduct](https://github.com/axios/axios/blob/v1.x/CODE_OF_CONDUCT.md) +- [Changelog](https://github.com/axios/axios/blob/v1.x/CHANGELOG.md) +- [Ecosystem](https://github.com/axios/axios/blob/v1.x/ECOSYSTEM.md) +- [Contributing Guide](https://github.com/axios/axios/blob/v1.x/CONTRIBUTING.md) +- [Code of Conduct](https://github.com/axios/axios/blob/v1.x/CODE_OF_CONDUCT.md) ## Credits diff --git a/index.d.ts b/index.d.ts index fa3110e1..0ab1277c 100644 --- a/index.d.ts +++ b/index.d.ts @@ -1,29 +1,49 @@ // TypeScript Version: 4.7 type StringLiteralsOrString = Literals | (string & {}); -export type AxiosHeaderValue = AxiosHeaders | string | string[] | number | boolean | null; +export type AxiosHeaderValue = + | AxiosHeaders + | string + | string[] + | number + | boolean + | null; interface RawAxiosHeaders { [key: string]: AxiosHeaderValue; } -type MethodsHeaders = Partial<{ - [Key in Method as Lowercase]: AxiosHeaders; -} & {common: AxiosHeaders}>; +type MethodsHeaders = Partial< + { + [Key in Method as Lowercase]: AxiosHeaders; + } & { common: AxiosHeaders } +>; -type AxiosHeaderMatcher = string | RegExp | ((this: AxiosHeaders, value: string, name: string) => boolean); +type AxiosHeaderMatcher = + | string + | RegExp + | ((this: AxiosHeaders, value: string, name: string) => boolean); -type AxiosHeaderParser = (this: AxiosHeaders, value: AxiosHeaderValue, header: string) => any; +type AxiosHeaderParser = ( + this: AxiosHeaders, + value: AxiosHeaderValue, + header: string, +) => any; export class AxiosHeaders { - constructor( - headers?: RawAxiosHeaders | AxiosHeaders | string - ); + constructor(headers?: RawAxiosHeaders | AxiosHeaders | string); [key: string]: any; - set(headerName?: string, value?: AxiosHeaderValue, rewrite?: boolean | AxiosHeaderMatcher): AxiosHeaders; - set(headers?: RawAxiosHeaders | AxiosHeaders | string, rewrite?: boolean): AxiosHeaders; + set( + headerName?: string, + value?: AxiosHeaderValue, + rewrite?: boolean | AxiosHeaderMatcher, + ): AxiosHeaders; + set( + headers?: RawAxiosHeaders | AxiosHeaders | string, + rewrite?: boolean, + ): AxiosHeaders; get(headerName: string, parser: RegExp): RegExpExecArray | null; get(headerName: string, matcher?: true | AxiosHeaderParser): AxiosHeaderValue; @@ -36,7 +56,11 @@ export class AxiosHeaders { normalize(format: boolean): AxiosHeaders; - concat(...targets: Array): AxiosHeaders; + concat( + ...targets: Array< + AxiosHeaders | RawAxiosHeaders | string | undefined | null + > + ): AxiosHeaders; toJSON(asStrings?: boolean): RawAxiosHeaders; @@ -44,34 +68,56 @@ export class AxiosHeaders { static accessor(header: string | string[]): AxiosHeaders; - static concat(...targets: Array): AxiosHeaders; + static concat( + ...targets: Array< + AxiosHeaders | RawAxiosHeaders | string | undefined | null + > + ): AxiosHeaders; - setContentType(value: ContentType, rewrite?: boolean | AxiosHeaderMatcher): AxiosHeaders; + setContentType( + value: ContentType, + rewrite?: boolean | AxiosHeaderMatcher, + ): AxiosHeaders; getContentType(parser?: RegExp): RegExpExecArray | null; getContentType(matcher?: AxiosHeaderMatcher): AxiosHeaderValue; hasContentType(matcher?: AxiosHeaderMatcher): boolean; - setContentLength(value: AxiosHeaderValue, rewrite?: boolean | AxiosHeaderMatcher): AxiosHeaders; + setContentLength( + value: AxiosHeaderValue, + rewrite?: boolean | AxiosHeaderMatcher, + ): AxiosHeaders; getContentLength(parser?: RegExp): RegExpExecArray | null; getContentLength(matcher?: AxiosHeaderMatcher): AxiosHeaderValue; hasContentLength(matcher?: AxiosHeaderMatcher): boolean; - setAccept(value: AxiosHeaderValue, rewrite?: boolean | AxiosHeaderMatcher): AxiosHeaders; + setAccept( + value: AxiosHeaderValue, + rewrite?: boolean | AxiosHeaderMatcher, + ): AxiosHeaders; getAccept(parser?: RegExp): RegExpExecArray | null; getAccept(matcher?: AxiosHeaderMatcher): AxiosHeaderValue; hasAccept(matcher?: AxiosHeaderMatcher): boolean; - setUserAgent(value: AxiosHeaderValue, rewrite?: boolean | AxiosHeaderMatcher): AxiosHeaders; + setUserAgent( + value: AxiosHeaderValue, + rewrite?: boolean | AxiosHeaderMatcher, + ): AxiosHeaders; getUserAgent(parser?: RegExp): RegExpExecArray | null; getUserAgent(matcher?: AxiosHeaderMatcher): AxiosHeaderValue; hasUserAgent(matcher?: AxiosHeaderMatcher): boolean; - setContentEncoding(value: AxiosHeaderValue, rewrite?: boolean | AxiosHeaderMatcher): AxiosHeaders; + setContentEncoding( + value: AxiosHeaderValue, + rewrite?: boolean | AxiosHeaderMatcher, + ): AxiosHeaders; getContentEncoding(parser?: RegExp): RegExpExecArray | null; getContentEncoding(matcher?: AxiosHeaderMatcher): AxiosHeaderValue; hasContentEncoding(matcher?: AxiosHeaderMatcher): boolean; - setAuthorization(value: AxiosHeaderValue, rewrite?: boolean | AxiosHeaderMatcher): AxiosHeaders; + setAuthorization( + value: AxiosHeaderValue, + rewrite?: boolean | AxiosHeaderMatcher, + ): AxiosHeaders; getAuthorization(parser?: RegExp): RegExpExecArray | null; getAuthorization(matcher?: AxiosHeaderMatcher): AxiosHeaderValue; hasAuthorization(matcher?: AxiosHeaderMatcher): boolean; @@ -81,19 +127,38 @@ export class AxiosHeaders { [Symbol.iterator](): IterableIterator<[string, AxiosHeaderValue]>; } -type CommonRequestHeadersList = 'Accept' | 'Content-Length' | 'User-Agent' | 'Content-Encoding' | 'Authorization'; +type CommonRequestHeadersList = + | "Accept" + | "Content-Length" + | "User-Agent" + | "Content-Encoding" + | "Authorization"; -type ContentType = AxiosHeaderValue | 'text/html' | 'text/plain' | 'multipart/form-data' | 'application/json' | 'application/x-www-form-urlencoded' | 'application/octet-stream'; +type ContentType = + | AxiosHeaderValue + | "text/html" + | "text/plain" + | "multipart/form-data" + | "application/json" + | "application/x-www-form-urlencoded" + | "application/octet-stream"; -export type RawAxiosRequestHeaders = Partial; +export type RawAxiosRequestHeaders = Partial< + RawAxiosHeaders & { + [Key in CommonRequestHeadersList]: AxiosHeaderValue; + } & { + "Content-Type": ContentType; + } +>; export type AxiosRequestHeaders = RawAxiosRequestHeaders & AxiosHeaders; -type CommonResponseHeadersList = 'Server' | 'Content-Type' | 'Content-Length' | 'Cache-Control'| 'Content-Encoding'; +type CommonResponseHeadersList = + | "Server" + | "Content-Type" + | "Content-Length" + | "Cache-Control" + | "Content-Encoding"; type RawCommonResponseHeaders = { [Key in CommonResponseHeadersList]: AxiosHeaderValue; @@ -101,16 +166,27 @@ type RawCommonResponseHeaders = { "set-cookie": string[]; }; -export type RawAxiosResponseHeaders = Partial; +export type RawAxiosResponseHeaders = Partial< + RawAxiosHeaders & RawCommonResponseHeaders +>; export type AxiosResponseHeaders = RawAxiosResponseHeaders & AxiosHeaders; export interface AxiosRequestTransformer { - (this: InternalAxiosRequestConfig, data: any, headers: AxiosRequestHeaders): any; + ( + this: InternalAxiosRequestConfig, + data: any, + headers: AxiosRequestHeaders, + ): any; } export interface AxiosResponseTransformer { - (this: InternalAxiosRequestConfig, data: any, headers: AxiosResponseHeaders, status?: number): any; + ( + this: InternalAxiosRequestConfig, + data: any, + headers: AxiosResponseHeaders, + status?: number, + ): any; } export interface AxiosAdapter { @@ -196,39 +272,61 @@ export enum HttpStatusCode { } export type Method = - | 'get' | 'GET' - | 'delete' | 'DELETE' - | 'head' | 'HEAD' - | 'options' | 'OPTIONS' - | 'post' | 'POST' - | 'put' | 'PUT' - | 'patch' | 'PATCH' - | 'purge' | 'PURGE' - | 'link' | 'LINK' - | 'unlink' | 'UNLINK'; + | "get" + | "GET" + | "delete" + | "DELETE" + | "head" + | "HEAD" + | "options" + | "OPTIONS" + | "post" + | "POST" + | "put" + | "PUT" + | "patch" + | "PATCH" + | "purge" + | "PURGE" + | "link" + | "LINK" + | "unlink" + | "UNLINK"; export type ResponseType = - | 'arraybuffer' - | 'blob' - | 'document' - | 'json' - | 'text' - | 'stream' - | 'formdata'; + | "arraybuffer" + | "blob" + | "document" + | "json" + | "text" + | "stream" + | "formdata"; export type responseEncoding = - | 'ascii' | 'ASCII' - | 'ansi' | 'ANSI' - | 'binary' | 'BINARY' - | 'base64' | 'BASE64' - | 'base64url' | 'BASE64URL' - | 'hex' | 'HEX' - | 'latin1' | 'LATIN1' - | 'ucs-2' | 'UCS-2' - | 'ucs2' | 'UCS2' - | 'utf-8' | 'UTF-8' - | 'utf8' | 'UTF8' - | 'utf16le' | 'UTF16LE'; + | "ascii" + | "ASCII" + | "ansi" + | "ANSI" + | "binary" + | "BINARY" + | "base64" + | "BASE64" + | "base64url" + | "BASE64URL" + | "hex" + | "HEX" + | "latin1" + | "LATIN1" + | "ucs-2" + | "UCS-2" + | "ucs2" + | "UCS2" + | "utf-8" + | "UTF-8" + | "utf8" + | "UTF8" + | "utf16le" + | "UTF16LE"; export interface TransitionalOptions { silentJSONParsing?: boolean; @@ -251,11 +349,11 @@ export interface FormDataVisitorHelpers { export interface SerializerVisitor { ( - this: GenericFormData, - value: any, - key: string | number, - path: null | Array, - helpers: FormDataVisitorHelpers + this: GenericFormData, + value: any, + key: string | number, + path: null | Array, + helpers: FormDataVisitorHelpers, ): boolean; } @@ -267,8 +365,7 @@ export interface SerializerOptions { } // tslint:disable-next-line -export interface FormSerializerOptions extends SerializerOptions { -} +export interface FormSerializerOptions extends SerializerOptions {} export interface ParamEncoder { (value: any, defaultEncoder: (value: any) => any): any; @@ -304,7 +401,7 @@ export interface AxiosProgressEvent { type Milliseconds = number; -type AxiosAdapterName = StringLiteralsOrString<'xhr' | 'http' | 'fetch'>; +type AxiosAdapterName = StringLiteralsOrString<"xhr" | "http" | "fetch">; type AxiosAdapterConfig = AxiosAdapter | AxiosAdapterName; @@ -344,7 +441,13 @@ export interface AxiosRequestConfig { maxBodyLength?: number; maxRedirects?: number; maxRate?: number | [MaxUploadRate, MaxDownloadRate]; - beforeRedirect?: (options: Record, responseDetails: {headers: Record, statusCode: HttpStatusCode}) => void; + beforeRedirect?: ( + options: Record, + responseDetails: { + headers: Record; + statusCode: HttpStatusCode; + }, + ) => void; socketPath?: string | null; transport?: any; httpAgent?: any; @@ -357,20 +460,55 @@ export interface AxiosRequestConfig { insecureHTTPParser?: boolean; env?: { FormData?: new (...args: any[]) => object; - fetch?: (input: URL | Request | string, init?: RequestInit) => Promise; - Request?: new (input: URL | Request | string, init?: RequestInit) => Request; + fetch?: ( + input: URL | Request | string, + init?: RequestInit, + ) => Promise; + Request?: new ( + input: URL | Request | string, + init?: RequestInit, + ) => Request; Response?: new ( - body?: ArrayBuffer | ArrayBufferView | Blob | FormData | URLSearchParams | string | null, - init?: ResponseInit + body?: + | ArrayBuffer + | ArrayBufferView + | Blob + | FormData + | URLSearchParams + | string + | null, + init?: ResponseInit, ) => Response; }; formSerializer?: FormSerializerOptions; family?: AddressFamily; - lookup?: ((hostname: string, options: object, cb: (err: Error | null, address: LookupAddress | LookupAddress[], family?: AddressFamily) => void) => void) | - ((hostname: string, options: object) => Promise<[address: LookupAddressEntry | LookupAddressEntry[], family?: AddressFamily] | LookupAddress>); - withXSRFToken?: boolean | ((config: InternalAxiosRequestConfig) => boolean | undefined); + lookup?: + | (( + hostname: string, + options: object, + cb: ( + err: Error | null, + address: LookupAddress | LookupAddress[], + family?: AddressFamily, + ) => void, + ) => void) + | (( + hostname: string, + options: object, + ) => Promise< + | [ + address: LookupAddressEntry | LookupAddressEntry[], + family?: AddressFamily, + ] + | LookupAddress + >); + withXSRFToken?: + | boolean + | ((config: InternalAxiosRequestConfig) => boolean | undefined); parseReviver?: (this: any, key: string, value: any) => any; - fetchOptions?: Omit | Record; + fetchOptions?: + | Omit + | Record; httpVersion?: 1 | 2; http2Options?: Record & { sessionTimeout?: number; @@ -380,7 +518,9 @@ export interface AxiosRequestConfig { // Alias export type RawAxiosRequestConfig = AxiosRequestConfig; -export interface InternalAxiosRequestConfig extends AxiosRequestConfig { +export interface InternalAxiosRequestConfig< + D = any, +> extends AxiosRequestConfig { headers: AxiosRequestHeaders; } @@ -398,11 +538,17 @@ export interface HeadersDefaults { unlink?: RawAxiosRequestHeaders; } -export interface AxiosDefaults extends Omit, 'headers'> { +export interface AxiosDefaults extends Omit< + AxiosRequestConfig, + "headers" +> { headers: HeadersDefaults; } -export interface CreateAxiosDefaults extends Omit, 'headers'> { +export interface CreateAxiosDefaults extends Omit< + AxiosRequestConfig, + "headers" +> { headers?: RawAxiosRequestHeaders | AxiosHeaders | Partial; } @@ -410,18 +556,18 @@ export interface AxiosResponse { data: T; status: number; statusText: string; - headers: H & RawAxiosResponseHeaders | AxiosResponseHeaders; + headers: (H & RawAxiosResponseHeaders) | AxiosResponseHeaders; config: InternalAxiosRequestConfig; request?: any; } export class AxiosError extends Error { constructor( - message?: string, - code?: string, - config?: InternalAxiosRequestConfig, - request?: any, - response?: AxiosResponse + message?: string, + code?: string, + config?: InternalAxiosRequestConfig, + request?: any, + response?: AxiosResponse, ); config?: InternalAxiosRequestConfig; @@ -440,7 +586,7 @@ export class AxiosError extends Error { request?: any, response?: AxiosResponse, customProps?: object, -): AxiosError; + ): AxiosError; static readonly ERR_FR_TOO_MANY_REDIRECTS = "ERR_FR_TOO_MANY_REDIRECTS"; static readonly ERR_BAD_OPTION_VALUE = "ERR_BAD_OPTION_VALUE"; static readonly ERR_BAD_OPTION = "ERR_BAD_OPTION"; @@ -500,12 +646,12 @@ type AxiosInterceptorRejected = (error: any) => any; type AxiosRequestInterceptorUse = ( onFulfilled?: AxiosInterceptorFulfilled | null, onRejected?: AxiosInterceptorRejected | null, - options?: AxiosInterceptorOptions + options?: AxiosInterceptorOptions, ) => number; type AxiosResponseInterceptorUse = ( onFulfilled?: AxiosInterceptorFulfilled | null, - onRejected?: AxiosInterceptorRejected | null + onRejected?: AxiosInterceptorRejected | null, ) => number; interface AxiosInterceptorHandler { @@ -516,7 +662,9 @@ interface AxiosInterceptorHandler { } export interface AxiosInterceptorManager { - use: V extends AxiosResponse ? AxiosResponseInterceptorUse : AxiosRequestInterceptorUse; + use: V extends AxiosResponse + ? AxiosResponseInterceptorUse + : AxiosRequestInterceptorUse; eject(id: number): void; clear(): void; handlers?: Array>; @@ -530,28 +678,71 @@ export class Axios { response: AxiosInterceptorManager; }; getUri(config?: AxiosRequestConfig): string; - request, D = any>(config: AxiosRequestConfig): Promise; - get, D = any>(url: string, config?: AxiosRequestConfig): Promise; - delete, D = any>(url: string, config?: AxiosRequestConfig): Promise; - head, D = any>(url: string, config?: AxiosRequestConfig): Promise; - options, D = any>(url: string, config?: AxiosRequestConfig): Promise; - post, D = any>(url: string, data?: D, config?: AxiosRequestConfig): Promise; - put, D = any>(url: string, data?: D, config?: AxiosRequestConfig): Promise; - patch, D = any>(url: string, data?: D, config?: AxiosRequestConfig): Promise; - postForm, D = any>(url: string, data?: D, config?: AxiosRequestConfig): Promise; - putForm, D = any>(url: string, data?: D, config?: AxiosRequestConfig): Promise; - patchForm, D = any>(url: string, data?: D, config?: AxiosRequestConfig): Promise; + request, D = any>( + config: AxiosRequestConfig, + ): Promise; + get, D = any>( + url: string, + config?: AxiosRequestConfig, + ): Promise; + delete, D = any>( + url: string, + config?: AxiosRequestConfig, + ): Promise; + head, D = any>( + url: string, + config?: AxiosRequestConfig, + ): Promise; + options, D = any>( + url: string, + config?: AxiosRequestConfig, + ): Promise; + post, D = any>( + url: string, + data?: D, + config?: AxiosRequestConfig, + ): Promise; + put, D = any>( + url: string, + data?: D, + config?: AxiosRequestConfig, + ): Promise; + patch, D = any>( + url: string, + data?: D, + config?: AxiosRequestConfig, + ): Promise; + postForm, D = any>( + url: string, + data?: D, + config?: AxiosRequestConfig, + ): Promise; + putForm, D = any>( + url: string, + data?: D, + config?: AxiosRequestConfig, + ): Promise; + patchForm, D = any>( + url: string, + data?: D, + config?: AxiosRequestConfig, + ): Promise; } export interface AxiosInstance extends Axios { - , D = any>(config: AxiosRequestConfig): Promise; - , D = any>(url: string, config?: AxiosRequestConfig): Promise; + , D = any>( + config: AxiosRequestConfig, + ): Promise; + , D = any>( + url: string, + config?: AxiosRequestConfig, + ): Promise; create(config?: CreateAxiosDefaults): AxiosInstance; - defaults: Omit & { + defaults: Omit & { headers: HeadersDefaults & { - [key: string]: AxiosHeaderValue - } + [key: string]: AxiosHeaderValue; + }; }; } @@ -565,13 +756,23 @@ export interface GenericHTMLFormElement { submit(): void; } -export function getAdapter(adapters: AxiosAdapterConfig | AxiosAdapterConfig[] | undefined): AxiosAdapter; +export function getAdapter( + adapters: AxiosAdapterConfig | AxiosAdapterConfig[] | undefined, +): AxiosAdapter; -export function toFormData(sourceObj: object, targetFormData?: GenericFormData, options?: FormSerializerOptions): GenericFormData; +export function toFormData( + sourceObj: object, + targetFormData?: GenericFormData, + options?: FormSerializerOptions, +): GenericFormData; -export function formToJSON(form: GenericFormData|GenericHTMLFormElement): object; +export function formToJSON( + form: GenericFormData | GenericHTMLFormElement, +): object; -export function isAxiosError(payload: any): payload is AxiosError; +export function isAxiosError( + payload: any, +): payload is AxiosError; export function spread(callback: (...args: T[]) => R): (array: T[]) => R; @@ -579,7 +780,10 @@ export function isCancel(value: any): value is CanceledError; export function all(values: Array>): Promise; -export function mergeConfig(config1: AxiosRequestConfig, config2: AxiosRequestConfig): AxiosRequestConfig; +export function mergeConfig( + config1: AxiosRequestConfig, + config2: AxiosRequestConfig, +): AxiosRequestConfig; export interface AxiosStatic extends AxiosInstance { Cancel: CancelStatic;