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

940 Commits

Author SHA1 Message Date
Jay f2b478f7ff Revert "Fixing default transformRequest with buffer pools (#1511)" (#2982)
This reverts commit a9a3b5e22b.
2020-05-27 20:05:26 +02:00
Taegyeoung Oh d35b5b5902 Remove axios.all() and axios.spread() from Readme.md (#2727)
* Updating Readme.md
- remove axios.all(), axios.spread()

* Updating Readme.md
- replace example
- axios.all() -> Promise.all()
- axios.spread(function (acct, perms)) -> function (acct, perms)
- add deprecated mark

* Update README.md

Make changes after review

Co-authored-by: Jay <jasonsaayman@gmail.com>
2020-05-27 19:43:08 +02:00
marcinx 6d36dbe7b7 Update README.md (#2887)
Small change to the data attribute doc of the config. A request body can also be set for DELETE methods but this wasn't mentioned in the documentation (it only mentioned POST, PUT and PATCH). Took my some 10-20 minutes until I realized that I don't need to manipulate the request body with transformRequest in the case of DELETE.

Co-authored-by: Jay <jasonsaayman@gmail.com>
2020-05-27 19:26:13 +02:00
Taemin Shin b03f16159e Fixing an issue that type 'null' is not assignable to validateStatus (#2773)
Co-authored-by: Xianming Zhong <chinesedfan@qq.com>
Co-authored-by: Jay <jasonsaayman@gmail.com>
2020-05-27 19:18:28 +02:00
Michał Zarach 029c36e193 Include swagger-taxos-codegen in ECOSYSTEM.md (#2162)
Co-authored-by: Jay <jasonsaayman@gmail.com>
2020-05-27 19:12:49 +02:00
Zac Delventhal a9a3b5e22b Fixing default transformRequest with buffer pools (#1511)
* Fixing default transformRequest of TypedArrays with buffer pools

A buffer pool is a large ArrayBuffer of a preset size used with a TypedArray
such as Uint8Array. This can speed up performance when constructing TypedArrays
of unknown sizes, and is a technique used by Node with their Buffers, and
by libraries like dcodeIO/protobuf.js.

Because the ArrayBuffer of such a TypedArray is much longer than the array
itself, using `.buffer` to transform the array before POSTing results in
sending a request with many extraneous empty bytes, which is wastefule and may
result in unexpected behavior.

Using `.slice()` before grabbing the ArrayBuffer fixes the problem by creating
a new TypedArray with a buffer of the expected length.

Signed-off-by: Zac Delventhal <delventhalz@gmail.com>

* Adding test for using default transformRequest with buffer pools

Adds a new test to the default transformRequest, running it on a
Uint8Array with a byte length of 16, but a much larger ArrayBuffer
with a byte length of 256. The transformed array should not include
any extra bytes, and so must have a byte length of just 16.

Signed-off-by: Zac Delventhal <delventhalz@gmail.com>

Co-authored-by: Zac Delventhal <zac@bitwise.io>
Co-authored-by: Jay <jasonsaayman@gmail.com>
2020-05-27 14:42:41 +02:00
David 8a8c534a60 Fixing special char encoding (#1671)
* removing @ character from replacement list since it is a reserved character

* Updating buildURL test to not include the @ character

* Removing console logs

Co-authored-by: Jay <jasonsaayman@gmail.com>
2020-05-27 14:37:39 +02:00
Petr Mares 5effc0827e Fixing password encoding with special characters in basic authentication (#1492)
* Fixing password encoding with special characters in basic authentication

* Adding test to check if password with non-Latin1 characters pass

Co-authored-by: petr.mares <petr.mares@linecorp.com>
Co-authored-by: Jay <jasonsaayman@gmail.com>
2020-05-26 18:32:03 +02:00
huangzuizui a98755c00a fix 'Network Error' in react native android (#1487)
There is a bug in react native Android platform when using get method.  It will trigger a 'Network Error' when passing the requestData which is an empty string to request.send function. So if the  requestData is an empty string we can set it to null as well to fix the bug.

Co-authored-by: Jay <jasonsaayman@gmail.com>
2020-05-23 19:06:10 +02:00
Jay cbda78552b Revert "Bug/allow header to contain http verb keys #1252 (#1258)" (#2977)
This reverts commit 920510b3a6.
2020-05-22 21:44:26 +02:00
David Ko 920510b3a6 Bug/allow header to contain http verb keys #1252 (#1258)
* Failing test for #1252

* Only delete header keys that match an HTTP verb if the value is a non-string

Co-authored-by: David Ko <david.ko@pvtmethod.com>
Co-authored-by: Jay <jasonsaayman@gmail.com>
2020-05-22 21:26:10 +02:00
Ryan Bown 1cdf9e4039 Fixing Cookie Helper with Asyc Components (#1105) (#1107)
Co-authored-by: Jay <jasonsaayman@gmail.com>
2020-05-22 16:44:17 +02:00
Samina Fu 021e741aa1 Add CDNJS version badge in README.md (#878)
This badge will show the version on CDNJS!

Co-authored-by: Jay <jasonsaayman@gmail.com>
2020-05-22 16:09:09 +02:00
Jay fd57956a7e Documentation update to clear up ambiguity in code examples (#2928)
* Made a adjustment to the documenation to clear up any ambiguity around the use of "fs". This should help clear up that the code examples with "fs" cannot be used on the client side.

Co-authored-by: Jay <jason.saayman@basebone.com>
2020-05-05 13:44:07 +02:00
hexaez 16b5718954 Update README.md about validateStatus (#2912)
Rewrote the comment from "Reject only if the status code is greater than or equal to 500" to "Resolve only if the status code is less than 500"
2020-04-22 15:59:26 +02:00
Remco Haszing 5e0fb5fc99 Updating documentation for usage form-data (#2805)
Closes #2049

Co-authored-by: Xianming Zhong <chinesedfan@qq.com>
2020-04-05 18:01:38 +08:00
Benny Neugebauer c120f44d3d Fixing 'progressEvent' type (#2851)
* Fix 'progressEvent' type

* Update axios.ts
2020-03-28 17:51:42 +08:00
Alan Wang 885ada6d9b Fixing getting local files (file://) failed (#2470)
* fix issue #2416, #2396

* fix Eslint warn

* Modify judgment conditions

* add unit test

* update unit test

* update unit test
2020-03-23 21:49:38 +08:00
Motonori Iwata 5189afff38 Allow PURGE method in typings (#2191)
Co-authored-by: Xianming Zhong <chinesedfan@qq.com>
2020-03-07 14:45:25 +08:00
grumblerchester c98ce7d464 Adding tests for method options type definitions (#1996)
Update tests.

Co-authored-by: Xianming Zhong <chinesedfan@qq.com>
2020-03-07 14:10:34 +08:00
Spencer von der Ohe 42eb9dfabc Adding option to disable automatic decompression (#2661)
* Adding ability to disable auto decompression

* Updating decompress documentation in README

* Fixing test\unit\adapters\http.js lint errors

* Adding test for disabling auto decompression

* Removing changes that fixed lint errors in tests

* Removing formating change to unit test

Co-authored-by: Xianming Zhong <chinesedfan@qq.com>
2020-03-06 22:01:58 +08:00
Gustavo López 6642ca9aa1 Add independent maxBodyLength option (#2781)
* Add independent option to set the maximum size of the request body

* Remove maxBodyLength check

* Update README

* Assert for error code and message
2020-03-06 21:55:19 +08:00
Xianming Zhong 5214445139 Add test for redirecting with too large response (#2695) 2020-02-29 19:54:41 +08:00
Fonger ac777b13b0 Fixing CHANGELOG.md issue link (#2784) 2020-02-28 10:15:59 +08:00
Simone Busoli 8cd470c613 Include axios-hooks in ECOSYSTEM.md (#2003) 2020-02-26 20:13:37 +08:00
Alexandru Ungureanu 67e560da10 Added Response header access instructions (#1901)
* Added Response header access instructions

* Added note about using bracket notation
2020-02-26 19:03:20 +08:00
Ian Wijma b139abfc36 Add onUploadProgress and onDownloadProgress are browser only (#2763)
Saw in #928 and #1966 that `onUploadProgress` and `onDownloadProgress` only work in the browser and was missing that from the README.

Co-authored-by: Xianming Zhong <chinesedfan@qq.com>
2020-02-26 10:28:49 +08:00
Jimmy Liao 3d6cafb3f7 Update ' sign to ` in proxy spec (#2778) 2020-02-25 23:05:51 +08:00
Thibault Ehrhart 17a967123c Adding responseEncoding to mergeConfig (#1745)
Co-authored-by: Xianming Zhong <chinesedfan@qq.com>
2020-02-15 21:49:26 +08:00
Lukas Drgon 2cf6ae4608 Adding jsDelivr link in README (#1110)
* Adding jsDelivr link

* Add SRI

* Remove SRI

Co-authored-by: Yasu Flores <carlosyasu91@gmail.com>
Co-authored-by: Xianming Zhong <chinesedfan@qq.com>
2020-02-15 20:48:16 +08:00
jennynju 9267d4def1 Fixing unit test failure in Windows OS (#2601)
Co-authored-by: Xianming Zhong <chinesedfan@qq.com>
2020-02-15 19:03:34 +08:00
Nikita Galkin 12e00b8018 Fixing issue for HEAD method and gziped repsonse (#2666) 2020-02-15 18:10:58 +08:00
Xianming Zhong 2034c1db7e Fix tests in browsers (#2748) 2020-02-15 15:54:43 +08:00
Xianming Zhong 56b72bbd2c Compatible with follow-redirect aborts the request (#2689)
* Compatible with follow-redirect aborts the request

* Use the error code
2020-02-15 13:41:08 +08:00
Jonathan Sharpe 77f0ae4f61 Fix merging of params (#2656)
* Name function to avoid ESLint func-names warning

* Switch params config to merge list and update tests

* Restore testing of both false and null

* Restore test cases for keys without defaults

* Include test for non-object values that aren't false-y.
2020-02-15 13:36:52 +08:00
JounQin 371d8eac79 chore: add jsdelivr and unpkg support (#2443) 2020-01-31 10:20:12 -08:00
Xianming Zhong 7df84a7ff7 Revert finally as then (#2683)
Co-authored-by: Yasu Flores <carlosyasu91@gmail.com>
2020-01-22 12:18:22 -08:00
Emily Morehouse 2a0ff479f9 Releasing 0.19.2 2020-01-21 21:24:50 -07:00
Emily Morehouse 17cc1d6d7a Updating changlog for 0.19.2 release 2020-01-20 09:24:56 -07:00
Xianming Zhong c7488c7dd5 Remove unnecessary XSS check introduced by #2451 (#2679)
* Remove unnecessary XSS check introduced by #2451

* Remove test file of `isValidXss`
2020-01-20 09:20:33 -07:00
Emily Morehouse 351cf290f0 Fix link formatting in CHANGELOG.md to display PR number in parens as link (#2643) 2020-01-07 11:54:03 -07:00
Emily Morehouse 960e1c8798 Releasing 0.19.1 2020-01-07 10:21:04 -07:00
Malik Dirim 8a9421de0f Fixing typo in CHANGELOG.md: s/Functionallity/Functionality (#2639) 2020-01-07 09:31:54 -07:00
不才 ee47120a09 If this place is false, it will report an error, so you should delete the useless code. (#2458) 2019-12-25 13:00:15 -08:00
Michael Shin 03e6f4bf4c Fixing invalid agent issue (#1904) 2019-12-25 12:55:36 -08:00
ZhaoXC dc4bc49673 fix: fix ignore set withCredentials false (#2582) 2019-12-08 23:52:45 -08:00
Alanscut 13c948e661 Remove 'includes' API, fix CI build failure (#2574)
* Remove 'includes' API, fix CI build failure
2019-12-09 10:28:37 +08:00
Alanscut fa6cf01c91 fixing Travis link (#2540) 2019-12-09 09:14:52 +08:00
Alanscut a17c70cb5a Fix CI build failure (#2570) 2019-11-26 11:09:42 -08:00
Angelos Chalaris 1a32ca0601 Remove dependency on is-buffer (#1816)
* Remove dependency on is-buffer from package.json
2019-11-17 22:53:27 -08:00