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

166 Commits

Author SHA1 Message Date
Dmitriy Mozgovoy 0c3a1e9fde Refactored module exports; (#5162)
* Refactored build pipeline;
Added module exports tests;
Added missing ESM export for parity with Axios factory;
Added `toFormData`, `formToJSON`, `isAxiosError`, `spread`, `isCancel`, `all` as named export to `index.d.ts`;

* Added ESM entry test;

* Updated README.md `installing` section;

* Added TypeScript importing test;
Added missed `CanceledError` & `AxiosHeaders` to `AxiosStatic` interface;

* Exclude `/test/module/` from tslint;
2022-10-30 18:46:17 +02:00
Jay 9bd53214f6 chore: release 1.1.3 2022-10-15 15:43:01 +02:00
littledian ef1c48a476 fix: eep top-level export same with static properties (#5109)
* chore: add necessary devDependencies for rollup build

* fix: keep top-level export same with static properties(#5031)

Co-authored-by: ronggui.shu <ronggui.shu@sci-inv.com>
Co-authored-by: Jay <jasonsaayman@gmail.com>
2022-10-13 22:17:06 +02:00
Jay 1b29f4e98e chore: release v1.1.2 2022-10-07 12:09:17 +02:00
Jay 6140fcf96f chore: updated changelog 2022-10-07 11:04:34 +02:00
Jay 9c3dce366b chore: release v1.1.0 2022-10-06 21:17:46 +02:00
Jay ff34f6dd51 chore: release v1.0.0 2022-10-04 20:25:21 +02:00
WD cec2287024 chore: remove unnecessary spaces (#4854)
Co-authored-by: Jay <jasonsaayman@gmail.com>
2022-09-15 07:25:21 +02:00
Dmitriy Mozgovoy cd8989a987 Fixed missed minified builds; (#4805)
* Fixed missed minified builds;
Refactored utils.js;
Refactored `utils.isStandardBrowserEnv()` as a `platform/browser` property;
Added builds size log;

* Replaced `rollup-plugin-filesize` with `rollup-plugin-bundle-size`;

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

* Fixed README.md href;

* Fixed a potential bug with headers normalization;

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

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

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

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

* Use `abortcontroller-polyfill`;

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

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

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

* Emit `progress` event in the next tick;

* Initial refactoring;

* Refactored Mocha tests to use ESM;

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

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

Co-authored-by: Jay <jasonsaayman@gmail.com>
2022-06-18 11:19:27 +02:00
Jay e90ced4957 docs: upgrade guide and changelog updated 2022-05-29 16:57:07 +02:00
Dmitriy Mozgovoy 467025bdb7 Fixed bug #4727 : toFormData Blob issue on node>v17; (#4728)
* Fixed bug #4727;
Added node 18.x to the CI;
Added hotfix for `ERR_OSSL_EVP_UNSUPPORTED` issue with karma running on node >=17.x;
Added `cross-env` to allow running build and test scripts on Windows platforms;

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

* Refactored ssl-hotfix & test script;

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

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

Co-authored-by: Jay <jasonsaayman@gmail.com>
2022-05-20 16:31:26 +02:00
Dmitriy Mozgovoy c30252f685 Added data URL support for node.js; (#4725)
* Added data URL support for node.js;
Added missed data URL protocol for the browser environment;
Optimized JSON parsing in the default response transformer;
Refactored project structure;
Added `cause` prop for AxiosError instance that refers to the original error if it was wrapped with `AxiosError.from` method;
Added fromDataURI helper;
Added test for handling data:url as an `arraybuffer|text|stream`;

* Added throwing of 405 HTTP error if the method is not GET;
2022-05-20 08:04:36 +02:00
Dmitriy Mozgovoy c05ad48952 Fixed toFormData regression bug (unreleased) with Array-like objects serialization; (#4714)
Added `toURLEncodedForm` helper;
Added automatic payload serialization to `application/x-www-form-urlencoded` to have parity with `multipart/form-data`;
Added test of handling `application/x-www-form-urlencoded` body by express.js;
Updated README.md;
Added missed param in JSDoc;
Fixed hrefs in README.md;

Co-authored-by: Jay <jasonsaayman@gmail.com>
2022-05-16 08:30:17 +02:00
Dmitriy Mozgovoy 807918bda2 Added enhanced toFormData implementation with additional options support; (#4704)
Updated default notation for arrays and objects to bracket style;
Added `multer/express.js` tests;
Updated README.md;

Co-authored-by: Jay <jasonsaayman@gmail.com>
2022-05-11 19:30:08 +02:00
Maxime Bargiel 495d5fb133 Resolving proxy from env on redirect (#4436)
* Fixing http adapter to recompute proxy on redirect

Redirections can target different hosts or change the protocol
from http to https or vice versa. When the proxy option is
inferred from the environment, it should be recomputed when
the protocol or host changes because the proxy host can differ
or even whether to proxy or not can differ.

* Fixing proxy protocol handling

1) setProxy now changes request options protocol when using a proxy with explicit protocol.
2) As a result, selection of the correct transport can be simplified.
3) Legacy agent selection needs to be moved done accordingly. (Is 'agent' option even still used?)

* Using proxy-from-env library to handle proxy env vars

The proxy-from-env library is a popular, lightweight library that is
very easy to use and covers a few more cases, not to mention it has
extensive test coverage.

* Fixing proxy auth handling

* Adding test proving env vars are re-resolved on redirect

* Revert unnecessary change

* Fixing proxy beforeRedirect regression

* Fixing lint errors

* Revert "Fixing lint errors"

This reverts commit 2de3cabc60db2444e63a699bae9ec45531218a84.

* Revert "Fixing proxy beforeRedirect regression"

This reverts commit 57befc3215980e47333fedc1e9028cc22297540b.
2022-05-11 19:24:14 +02:00
Dave Cardwell 8213929595 Bump follow-redirects from 1.14.9 to 1.15.0 (#4673)
Bumps [follow-redirects](https://github.com/follow-redirects/follow-redirects) from 1.14.9 to 1.15.0.
- [Commits](https://github.com/follow-redirects/follow-redirects/compare/v1.14.9...v1.15.0)
2022-05-04 09:53:12 +02:00
Dmitriy Mozgovoy fe2563060d Replaced webpack with rollup; (#4596)
Co-authored-by: Jay <jasonsaayman@gmail.com>
2022-05-03 18:53:02 +02:00
Jay bc733fec78 Releasing v0.27.2 2022-04-27 11:58:12 +02:00
Jay 82fd15f3d4 Combined build process and cleaned it up a bit 2022-04-26 14:24:18 +02:00
Jay 1d82af1a50 Fixing issues with bundle sizes 2022-04-26 14:23:05 +02:00
Jay cb9c534963 Releasing v0.27.1 2022-04-26 09:31:19 +02:00
Jay 167cb8b8e7 Remove eslint-g package as this seems have been added in error 2022-04-26 09:14:04 +02:00
Dmitriy Mozgovoy 4f7e3e3a7a Removed import of url module in browser build due to significant size overhead; (#4594)
Removed pointless `Malformed URL` checking in  client build;
2022-04-26 09:08:49 +02:00
Jay 008dd9d466 Releaseing version 0.27.0 2022-04-21 12:55:24 +02:00
Jay ee151a7356 Revert some changes that are only required when we actually release 2022-04-05 15:47:01 +02:00
Enrique Mingorance Cano 499d3bee54 follow-redirects to ^1.14.9 (#4562)
* follow-redirects to ^1.14.9

* CHANGELOG.md

* revert dist changes
2022-04-05 15:42:41 +02:00
Jay d24ce8e0d3 Updated a number of out of date dev packages 2022-04-01 21:18:41 +02:00
Jay 8699891b8e Fixed merge conflicts 2022-04-01 18:40:12 +02:00
Jay ac659112db Fixed issues created when merging 0.26.1 2022-03-19 14:36:42 +02:00
Dmitriy Mozgovoy 6b9b05b907 Improved FormData support; (#4448)
* Fixed isFormData predicate;
Added support for automatic object serialization to FormData if `Content-Type` is `multipart/form-data`;
Added support for FormData to be overloaded using `config.env.FormData` option;
Added support for FormData in node.js environment through `form-data` package;

* Added the `form-data` package as a dependency for the server build;
Added tests for FormData payload;

* Added FormData automatic serialization section;
Refactored cancellation section;

* Reworked toFormData helper;
Expose toFormData helper as a static method;
Refactored transform request;
Added kindOf, kindOfTest, endsWith, isTypedArray util;
Refactored utils.js to use kindOf for tests;

* Fixed isFormData predicate; (#4413)

Added support for automatic object serialization to FormData if `Content-Type` is `multipart/form-data`;
Added support for FormData to be overloaded using `config.env.FormData` option;
Added support for FormData in node.js environment using `form-data` package;

(cherry picked from commit 73e3bdb883)

* Added shortcut methods `postForm`, `putForm`, `patchForm` to submit a Form;
Added ability to submit FileList object as a FormData;
Updated README.md;

* Updated README.md;
2022-03-14 20:22:10 +02:00
Jay c9aca75257 Releasing v0.26.0 2022-02-13 16:20:24 +02:00
CookieMr c5bdbd436d Update follow-redirects dependency due to Vurnerbility
Previous version of follow-redirects dependency is reported
by Snyk to have a vurnerbility.
https://app.snyk.io/test/npm/follow-redirects/1.14.7
2022-02-11 14:58:12 +01:00
Jay 63dfce85ab Releasing v0.25 2022-01-18 09:13:27 +02:00
Gustavo Sales 51f3ccb08e Updating follow-redirects with security updates (#4379)
Co-authored-by: Gustavo Sales <gustavo@blastradius.ai>
2022-01-13 07:56:28 +02:00
Jay 6d613b4fe4 Updated changelog 2021-10-25 19:46:09 +02:00
Jay 1025d1231a Release v0.23.0 2021-10-12 17:34:26 +02:00
Remco Haszing 94a9344799 Test types (#4140)
* Distinguish request and response data types

* Fix Axios headers type

`axios.headers` is not of the same type as `request.headers`, so a new type
`AxiosDefaults` was introduced

* Replace grunt-ts with dtslint

This asserts that the type definitions are valid in the specified TypeScript
version and above. This is the same tool that is used by DefinitelyTyped.

* Remove grunt-ts

* Restore typescript dependency

* Fix missing semicolons

Co-authored-by: Claas Augner <github@caugner.de>
Co-authored-by: Jay <jasonsaayman@gmail.com>
2021-10-12 09:53:10 +02:00
Jay 76f09afc03 Release/v0.22.0 (#4107)
* fix/Avoid package.json import; (#4041)

* Added auto-generated config module `env/data.js` for importing package environment vars without importing the whole `package.json`;
Refactored `http.js` to use `env/data.js` instead of package.json;

* Added `env/data.js`;
Added `env/README.md`;

* Feat/export package version constant (#4065)

* Added auto-generated config module `env/data.js` for importing package environment vars without importing the whole `package.json`;
Refactored `http.js` to use `env/data.js` instead of package.json;

* Added `env/data.js`;
Added `env/README.md`;

* Export package version constant;

* Fixed cancelToken leakage; Added AbortController support; (#3305)

* Fixed cancelToken leakage;
Added AbortController support;

* Fixed typings;

* Documented `signal` option;

* Added processing of early cancellation using AbortController without sending a request;

Co-authored-by: Jay <jasonsaayman@gmail.com>

* Updating CI to run on release branches

* Fixed default transitional config for custom Axios instance; (#4052)

Refactored `/core/mergeConfig`;

Co-authored-by: Jay <jasonsaayman@gmail.com>

* Prepping v0.22.0 for release

* Updated date

Co-authored-by: Dmitriy Mozgovoy <robotshara@gmail.com>
2021-10-01 08:02:13 +02:00
Jay 4091b075f6 Release/0.21.4 (#4025)
* fix json transform when data is pre-stringified (#4020)

* [Updating] incorrect JSON syntax in README.md

* [Releasing] v0.21.4

Co-authored-by: Guillaume FORTAINE <guillaume+github@fortaine.com>
2021-09-06 17:35:06 +02:00
howel52 c26762f898 Adding types entry in package.json (#2831)
Co-authored-by: Jay <jasonsaayman@gmail.com>
2021-09-05 12:35:24 +02:00
Jay e367be54dc [Releasing] 0.21.3 2021-09-04 21:01:50 +02:00
Jay 619bb465da [Releasing] v0.21.2 2021-09-04 11:28:54 +02:00
Brian Anglin e9965bfafc Fixing the sauce labs tests (#3813) 2021-05-27 07:44:43 +02:00
Jay 59fa6147eb [Updated] follow-redirects to the latest version (#3771) 2021-04-29 18:08:00 +02:00
Jay d99d5faac2 Fix/karma sauce errors (#3717)
* [Updated] karma sauce launcher which should fix suace tests that are no longer showing as passed and rather completed

* [Updated] karma config to follow es-lint rules of axios

* [Updated] karma version to latest

* [Added] propper browsers when testing local
2021-04-01 07:41:15 +02:00
Jay c461ae9e97 [Updated] karma sauce launcher which should fix suace tests that are no longer showing as passed and rather completed (#3712) 2021-03-30 08:23:47 +02:00
Jay 364867edd2 [Updated] follow-redirects version (#3694)
I have updated the version of follow redirects to see if this will fix a potential memory leak that has been noted by a couple users. This is also being updated to see if it will pass building.
2021-03-23 16:47:51 +02:00
Jake 5c122b7eaf Change homepage link to https://axios-http.com (#3681) 2021-03-15 17:17:33 +02:00
Xianming Zhong 7d3b626a59 Merge branch 0.21.1 into master (#3610)
* Updating changelog for 0.21.1 release

* Releasing 0.21.1

Co-authored-by: Emily Morehouse <emily@cuttlesoft.com>
2021-01-31 20:17:04 +02:00