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

1198 Commits

Author SHA1 Message Date
Dmitriy Mozgovoy bd58c4e89b Updated eslint config; (#4722)
Co-authored-by: Jay <jasonsaayman@gmail.com>
2022-05-17 08:28:40 +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
Kirill Shakirov e6f9026d51 Fixing AxiosRequestHeaders typings (#4334)
Co-authored-by: Shakirov Kirill <ksshakirov@sberautotech.ru>
Co-authored-by: Jay <jasonsaayman@gmail.com>
2022-05-16 09:33:36 +02:00
Rraji Abdelbari ee51e68143 add string[] to AxiosRequestHeaders type (#4322)
Co-authored-by: Jay <jasonsaayman@gmail.com>
2022-05-16 09:21:56 +02:00
Jelle Schutter ed0ba0fd60 allow type definition for axios instance methods (#4224)
Co-authored-by: Jay <jasonsaayman@gmail.com>
2022-05-16 09:08:02 +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
Dmitriy Mozgovoy 65b92958ae Fixed AxiosError status code type; (#4717)
Co-authored-by: Jay <jasonsaayman@gmail.com>
2022-05-16 08:51:22 +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
Adrian Wieprzkowicz 13dd93f6c5 Expand isAxiosError types (#4344)
* Expand isAxiosError types

* Fix isAxiosError types

Add missing generic type variable

* Fix typo

Co-authored-by: Jay <jasonsaayman@gmail.com>
2022-05-12 09:19:07 +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
Lukas Hroch ac96144dd3 fix(types): allow to specify partial default headers for instance creation (#4185)
Co-authored-by: Jay <jasonsaayman@gmail.com>
2022-05-09 20:03:05 +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
Spencer 9f6ba5ee43 Fixing instance.defaults.headers type (#4557)
* Fixing instance.defaults.headers type

* remove console.log()

Co-authored-by: Jay <jasonsaayman@gmail.com>
2022-05-09 19:12:53 +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
Dave 6bd1a89657 docs(ECOSYSTEM): add react hook plugin (#4319)
Co-authored-by: Jay <jasonsaayman@gmail.com>
2022-05-09 18:33:50 +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
Jay 27280ec260 Removing the issue template enforcement as many people are complaining and multiple issue are just being closed even when valid 2022-05-09 18:02:16 +02:00
Jamie Slome 8d26147ae0 Update SECURITY.md (#4687) 2022-05-06 13:50:09 +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
rafw87 743b4a8b8f Add axios-url-template to Ecosystem (#4238)
Co-authored-by: Jay <jasonsaayman@gmail.com>
2022-05-05 21:08:05 +02:00
Afzal Sayed 7e56f8653c Fix grammatical issues in README (#4232)
* Fix grammatical issues in README

* Fix typo in COLLABORATOR_GUIDE.md

Co-authored-by: Jay <jasonsaayman@gmail.com>
2022-05-05 21:02:32 +02:00
Dmitriy Mozgovoy 384b7e6994 Added generic AxiosAbortSignal TS interface to avoid importing AbortController polyfill (#4229)
* Added generic `AxiosAbortSignal` TS interface to avoid importing AbortController polyfill;

* Renamed `AxiosAbortSignal` to `GenericAbortSignal` to use the same naming style as `GenericFormData`;

* Added TS test for `GenericAbortSignal` interface;

Co-authored-by: Jay <jasonsaayman@gmail.com>
2022-05-04 21:23:01 +02:00
Brian Helba eaaab30442 Fix TS definition for AxiosRequestTransformer (#4201)
The callback `AxiosRequestTransformer` can always expect its `headers`
parameter to be defined. This is ensured immediately before the callback
is made.
See: https://github.com/axios/axios/blob/1025d1231a7747503188459dd5a6d1effdcea928/lib/core/dispatchRequest.js#L32-L40

Co-authored-by: Jay <jasonsaayman@gmail.com>
2022-05-04 21:18:57 +02:00
reslear 1430393402 Update README.md (#4207)
Co-authored-by: Jay <jasonsaayman@gmail.com>
2022-05-04 21:12:12 +02:00
Jay a0d742c299 Merge branch 'master' of github.com:axios/axios 2022-05-04 20:55:02 +02:00
Jay 6e0ab653db Merge branch 'oscard0m-add-cache-to-node-workflows' 2022-05-04 20:52:50 +02:00
Jay 21edbc2c92 Fix merge conflict 2022-05-04 20:52:33 +02:00
Luca Pizzini 1de70bd130 refactor: added listen callback function (#4096)
Co-authored-by: Jay <jasonsaayman@gmail.com>
2022-05-04 20:42:36 +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
Jay e8e4749ebf Updated all browser logos to be correct 2022-05-04 19:27:42 +02:00
Kai b4d87ce6ca Updating HTTP links in README.md to use HTTPS (#4387)
Co-authored-by: Jay <jasonsaayman@gmail.com>
2022-05-04 18:15:37 +02:00
Maxime Bargiel 9ca2779d7a Fixing http tests to avoid hanging when assertions fail (#4435)
* Fixing cases of Axios hanging on test failures

* Fix max redirect assertion

Co-authored-by: Jay <jasonsaayman@gmail.com>
2022-05-04 17:54: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
Kumar Shanu 6b1ae0b84a Edited readme with 3 updated browser icons. (#4414)
In the main readme file of axios, the icons for chrome, firefox and safari was not visible, which was giving a bit outdated vibes. I have updated all the three icons with the latest ones from  "https://www.iconfinder.com/icons/23799/firefox_icon" in 48px dimension. I hope now it looks good.

Co-authored-by: Jay <jasonsaayman@gmail.com>
2022-05-03 21:46:08 +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
Dmitriy Mozgovoy ad27f803d7 Changed func-names eslint rule to as-needed; (#4492)
Co-authored-by: Jay <jasonsaayman@gmail.com>
2022-05-03 21:17:06 +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
Philipp Loose 3479ca7c76 Updating typing for AxiosPromise (#4505)
Co-authored-by: Jay <jasonsaayman@gmail.com>
2022-05-03 21:07:09 +02:00
Alexander Shchukin 484443f251 fix url to defaults.js (#4532)
fix url to defaults.js

Co-authored-by: Jay <jasonsaayman@gmail.com>
2022-05-03 20:35:59 +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
Dmitriy Mozgovoy c07998a621 Added generic TS types for the exposed toFormData helper; (#4668) 2022-05-03 20:29:50 +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