2
0
mirror of https://github.com/tenrok/axios.git synced 2026-05-18 12:39:44 +03:00
Commit Graph

463 Commits

Author SHA1 Message Date
Jay 18e563d7f8 docs(helpers/combineURLs) 2022-06-02 20:50:41 +02:00
Jay 714daab1e7 docs(helpers/deprecatedMethod) 2022-06-02 20:50:16 +02:00
Jay ff2f0b4bd7 docs(helpers/formDataToJSON) 2022-06-02 20:49:51 +02:00
Jay a0808db951 docs(helpers/fromDataURI) 2022-06-02 20:49:21 +02:00
Jay 10c20daa2b docs(helpers/isAbsoluteURL) 2022-06-02 20:48:55 +02:00
Jay 910a920c55 docs(helpers/isAxiosError) 2022-06-02 20:48:22 +02:00
Jay 0556288a96 docs(helpers/parseHeaders) 2022-06-02 20:47:56 +02:00
Jay 5e2ffa2209 chore(helpers/spread): added docs for spread functions 2022-06-02 20:46:44 +02:00
Jay ba3e593807 chore(helpers/toFormData): added docs for to form data functions 2022-06-02 20:46:05 +02:00
Jay 34b71f0a1c chore(helpers/validator): added docs for validator function 2022-06-02 20:45:27 +02:00
Jay 74f59eac88 chore(Utils): added docs for utils functions 2022-06-02 20:44:27 +02:00
Jay 3cf6ad7203 chore(release): v1 alpha 1 2022-05-31 21:14:45 +02:00
João Gabriel Quaresma 1504792765 Fixing content-type header repeated (#4745)
Co-authored-by: Jay <jasonsaayman@gmail.com>
2022-05-28 11:52:50 +02:00
Victor Augusto a11f9501b8 Fix/4737/timeout error message for http (#4738)
* Fixing timeoutErrorMessage in http calls

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

* Testing timeoutErrorMessage in http calls

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

Co-authored-by: Jay <jasonsaayman@gmail.com>
2022-05-28 11:46:33 +02:00
Dmitriy Mozgovoy c008e57fe4 Added axios.formToJSON method; (#4735)
* Draft

* Added `formDataToJSON` helper;
Added `axios.formToJSON` method;
Added client tests;

Co-authored-by: Jay <jasonsaayman@gmail.com>
2022-05-25 08:21:40 +02:00
Dmitriy Mozgovoy 934f390cc3 URL params serializer; (#4734)
* Refactored BuildURL helper to use URLSearchParams serializer;

* Updated typings;
Added TS test;
2022-05-25 08:16:38 +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
Dimitris Halatsis e9c9f3392b Fix/4263/maxbodylength defaults (#4731)
* test(http): add test case for default body length in follow-redirects

* fix(http): provide proper default body length to follow-redirects

Co-authored-by: Jay <jasonsaayman@gmail.com>
2022-05-20 08:27:37 +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 bd391247b4 Added the ability for the url-encoded-form serializer to respect the formSerializer config; (#4721)
Added test for `formSerializer` config in context of `url-encoded-form` serializer;
2022-05-17 08:26:35 +02:00
Dmitriy Mozgovoy d60d6844b1 Fixed AxiosError stack capturing; (#4718)
Co-authored-by: Jay <jasonsaayman@gmail.com>
2022-05-16 08:58:47 +02:00
Tom Ceuppens 9be61dc1c9 Allow webpack users to overwrite buildins (#4715)
Co-authored-by: Jay <jasonsaayman@gmail.com>
2022-05-16 08:46:46 +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
毛呆 e762cf77b3 Adding Canceler parameters config and request (#4711)
Co-authored-by: Jay <jasonsaayman@gmail.com>
2022-05-16 08:19:46 +02:00
Maxime Bargiel 24f22b2b0b Fixing proxy beforeRedirect regression (#4708) 2022-05-16 08:05:56 +02:00
Jamie Telin c6ec5fc867 Fixing Z_BUF_ERROR when no content (#4701)
* Fix Z_BUF_ERROR when no content

* Refactored code

* Fix undefined check

Co-authored-by: Jay <jasonsaayman@gmail.com>
2022-05-12 07:27:39 +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
Jay de5e006142 Revert "The content type option is left to the developer (#4550)" (#4699)
This reverts commit 9579bad1d3.
2022-05-09 20:16:21 +02:00
Dmitriy Mozgovoy 356b166182 Added blob to the list of protocols supported by the browser; (#4678)
Co-authored-by: Jay <jasonsaayman@gmail.com>
2022-05-09 19:27:18 +02:00
Koki Oyatsu 2f50c8249b Adding HTTP status code for transformResponse (#4580)
* Adding HTTP status code for transformResponse

* refs #1214

* Fix wrong argument for tranformResponse

* Fix test wrong argument for tranformData

* Add test case for transformData

* Add test case for transformData (reference headers case)

Co-authored-by: Jay <jasonsaayman@gmail.com>
2022-05-09 19:25:16 +02:00
Lawliet 9579bad1d3 The content type option is left to the developer (#4550)
* The content type option is left to the developer

If the browser recognizes the fault, it can protect the developer

Although I don't think Axios itself should interfere with developers' choices

This parameter is for compatibility with historical issues

* Update xhr.js

Co-authored-by: Jay <jasonsaayman@gmail.com>
2022-05-09 19:20:33 +02:00
暴走老七 4c898f8665 don\'t need to transform arguments to array (#4544)
Co-authored-by: Jay <jasonsaayman@gmail.com>
2022-05-09 19:08:57 +02:00
Dmitriy Mozgovoy de48c5d626 Fixed race condition on immediate requests cancellation (#4261)
* Fixes #4260: fixed race condition on immediate requests cancellation

* Update http.js

Co-authored-by: Jay <jasonsaayman@gmail.com>
2022-05-09 18:12:29 +02:00
Landro3 544cf134f3 Interceptor clear (#4248)
* Adding interceptor clearing

* Fixing spacing

* changed clear to empty array

* fixed interceptor clear test

Co-authored-by: Andrew <Andrew@Andrews-MacBook-Pro.local>
Co-authored-by: Jay <jasonsaayman@gmail.com>
2022-05-05 21:31:06 +02:00
Cat Scarlet 5affc9d08e Updating trim() polyfill. According to mdn: https://github.com/mdn/content/blob/cf607d68522cd35ee7670782d3ee3a361eaef2e4/files/en-us/web/javascript/reference/global_objects/string/trim/index.md (#4072)
Co-authored-by: Jay <jasonsaayman@gmail.com>
2022-05-04 20:25:23 +02:00
JALAL eef2f97281 replace deprecated substr() with slice() (#4468)
Co-authored-by: Jay <jasonsaayman@gmail.com>
2022-05-03 21:39:40 +02:00
Jingyi Lin ba85e0e385 style: fix word spelling ang lint style in comment (#4500)
Co-authored-by: Jay <jasonsaayman@gmail.com>
2022-05-03 21:12:16 +02:00
Arthur Fiorette ff1e5cd6c2 Include request and config when creating a CanceledError. (#4659)
* changes

* also include request

* revert comment

Co-authored-by: Jay <jasonsaayman@gmail.com>
2022-05-03 20:33:38 +02:00
zhoulixiang e52af17ee8 opt: opt judgment code of cancel (#4587)
Co-authored-by: Jay <jasonsaayman@gmail.com>
2022-05-03 19:04:58 +02:00
Des Preston 7920d11144 Updating AxiosError to include stack trace (#4624)
Related to discussions here https://github.com/axios/axios/issues/2387

Attempt to capture the stack trace at the time the error is created in
order to maintain context about where the error originates from.

Co-authored-by: Jay <jasonsaayman@gmail.com>
2022-05-03 18:46:10 +02:00
Dmitriy Mozgovoy 12faca87e0 Removed wrong argument for NetworkError constructor; (#4656) 2022-05-03 18:30:17 +02:00
Jay bc733fec78 Releasing v0.27.2 2022-04-27 11:58:12 +02:00
Dmitriy Mozgovoy b9e9fb4fa0 Enhanced protocol parsing implementation to fix #4633; (#4639)
Added unit tests;

Co-authored-by: Jay <jasonsaayman@gmail.com>
2022-04-27 11:30:50 +02:00
Dmitriy Mozgovoy 76432c18be Fixed FormData posting in browser environment by reverting #3785; (#4640)
* Fixed posting FormData in browser environment by reverting #3785;

* Added ability to keep `Content-Type` header in non-standard browser environments;

* Added browser test of FormData posting using external HTTP service (https://httpbin.org/post);

Co-authored-by: Jay <jasonsaayman@gmail.com>
2022-04-27 11:26:52 +02:00
Jay cb9c534963 Releasing v0.27.1 2022-04-26 09:31:19 +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