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

1020 Commits

Author SHA1 Message Date
howel52 c26762f898 Adding types entry in package.json (#2831)
Co-authored-by: Jay <jasonsaayman@gmail.com>
2021-09-05 12:35:24 +02:00
Isaac Whitfield 69d3cc4f3e Allow create() to be used recursively (#2795)
Co-authored-by: Jay <jasonsaayman@gmail.com>
2021-09-05 12:24:50 +02:00
Jay e367be54dc [Releasing] 0.21.3 2021-09-04 21:01:50 +02:00
Julian Hollmann 83ae3830e4 Correctly add response interceptors to interceptor chain (#4013) 2021-09-04 20:55:38 +02:00
Jay c0c8761091 [Updating] changelog to include links to issues and contributors 2021-09-04 11:57:32 +02:00
Jay 619bb465da [Releasing] v0.21.2 2021-09-04 11:28:54 +02:00
Ziding Zhang 82c9455591 Create SECURITY.md (#3981)
* Create SECURITY.md

A simple instruction for security researchers.

* Adding security report email address

Co-authored-by: Jay <jasonsaayman@gmail.com>
2021-09-02 10:14:12 +02:00
ready-research 5b457116e3 Security fix for ReDoS (#3980) 2021-08-30 14:33:43 +02:00
Matt Czapliński 5bc9ea24dd Update ECOSYSTEM.md (#3817)
Add axios-multi-api to the list

Co-authored-by: Jay <jasonsaayman@gmail.com>
2021-08-13 15:00:27 +02:00
Nash e72813a385 Fixing README.md (#3818)
* Fixing README.md

* Update README.md

Co-authored-by: Asher Hwang <dev@hsh.kr>

Co-authored-by: Asher Hwang <dev@hsh.kr>
Co-authored-by: Jay <jasonsaayman@gmail.com>
2021-08-13 14:57:35 +02:00
Sam Carlton e10a0270e9 Fix README typo under Request Config (#3825)
Co-authored-by: Jay <jasonsaayman@gmail.com>
2021-08-13 14:55:00 +02:00
Mo Sattler e091491127 Update README.md (#3936)
Fixing the example JSON of `Request Config`

Co-authored-by: Jay <jasonsaayman@gmail.com>
2021-08-13 14:45:46 +02:00
Jay b42fbad57b Removed un-needed bracket
Removed un-needed bracket
2021-08-13 14:36:02 +02:00
Jay 520c8dccde Updating CI status badge (#3953)
Updated CI status badge to show Github workflow status
2021-08-13 14:35:20 +02:00
Kohta Ito 4fbeecbcb2 Adding CI on Github Actions. (#3938) 2021-08-13 14:27:17 +02:00
Brian Anglin e9965bfafc Fixing the sauce labs tests (#3813) 2021-05-27 07:44:43 +02:00
Daniel Lopretto dbc634cf70 Remove charset in tests (#3807)
* removed charset setting when setting default header

* Remove charset from tests

Co-authored-by: mpark86 <dev.minuk.park@gmail.com>
Co-authored-by: Jay <jasonsaayman@gmail.com>
Co-authored-by: Pilot <timemachine@ctrl-c.club>
2021-05-21 07:51:31 +02:00
Jay 3958e9fbc8 Add explanation of cancel token (#3803)
Thanks to @socketpair for testing and checking this.
2021-05-18 09:08:20 +02:00
hippo 69949a6c16 Adding custom return type support to interceptor (#3783)
close #3448

Co-authored-by: Jay <jasonsaayman@gmail.com>
2021-05-14 16:08:36 +02:00
Jay 49509f6e95 Create FUNDING.yml (#3796)
Add open collective to repo
2021-05-13 14:48:43 +02:00
Philipe Gouveia Paixão 199c8aab64 Adding parseInt to config.timeout (#3781)
* Adding parseInt to config.timeout

* Fixing test message
2021-05-06 15:54:22 +02:00
Johannes Jarbratt 94fc4ea716 Adding isAxiosError typeguard documentation (#3767)
Co-authored-by: Jay <jasonsaayman@gmail.com>
2021-05-04 20:05:05 +02:00
Mark 0ece97c7a9 Fixing quadratic runtime when setting a maxContentLength (#3738)
Previously checking whether a response has exceeded `maxContentLength` was
quadratic with respect to the number of chunks in the response stream and
also caused unnecessary additional memory usage.

Co-authored-by: Jay <jasonsaayman@gmail.com>
2021-05-04 19:48:20 +02:00
TagawaHirotaka a18a0eccb5 Updating lib/core/README.md about Dispatching requests (#3772)
* Updating lib/core/README.md :Dispatching requests

* Fixing expression
2021-04-30 09:08:50 +02:00
Jay 59fa6147eb [Updated] follow-redirects to the latest version (#3771) 2021-04-29 18:08:00 +02:00
Dmitriy Mozgovoy 7821ed2089 Feat/json improvements (#3763)
* Draft

* Added support for primitive types to be converted to JSON if the request Content-Type is 'application/json';
Added throwing SyntaxError if JSON parsing failed and responseType is json;
Added transitional option object;
Added options validator to assert transitional options;
Added transitional option `silentJSONParsing= true` for backward compatibility;
Updated README.md;
Updated typings;

* Fixed isOlderVersion helper;
Fixed typo;
Added validator.spec.js;

* Added forcedJSONParsing transitional option #2791

* `transformData` is now called in the default configuration context if the function context is not specified (for tests compatibility);

* Added `transitional.clarifyTimeoutError` to throw ETIMEDOUT error instead of generic ECONNABORTED on request timeouts;
Added support of onloadend handler if available instead of onreadystatechange;
Added xhr timeout test;
Fixed potential bug of xhr adapter with proper handling timeouts&errors (FakeXMLHTTPRequest failed to handle timeouts);

* Removed unnecessary assertion;
2021-04-19 22:05:48 +02:00
Dmitriy Mozgovoy 5ad6994da3 JSON improvements: throw if JSON parsing failed; number, boolean can be passed directly as payload for encoding to JSON #2613, #61, #907 (#3688)
* Draft

* Added support for primitive types to be converted to JSON if the request Content-Type is 'application/json';
Added throwing SyntaxError if JSON parsing failed and responseType is json;
Added transitional option object;
Added options validator to assert transitional options;
Added transitional option `silentJSONParsing= true` for backward compatibility;
Updated README.md;
Updated typings;

* Fixed isOlderVersion helper;
Fixed typo;
Added validator.spec.js;

* Added forcedJSONParsing transitional option #2791

* `transformData` is now called in the default configuration context if the function context is not specified (for tests compatibility);

* Added `transitional.clarifyTimeoutError` to throw ETIMEDOUT error instead of generic ECONNABORTED on request timeouts;
Added support of onloadend handler if available instead of onreadystatechange;
Added xhr timeout test;
Fixed potential bug of xhr adapter with proper handling timeouts&errors (FakeXMLHTTPRequest failed to handle timeouts);
2021-04-19 18:55:34 +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
Mike Bishop b0959f0301 Adding ability to omit User-Agent header (#3703)
* Adding ability to omit User-Agent header

* Update line to be more compact

* Add unit tests for user-agent cases

Co-authored-by: Jay <jasonsaayman@gmail.com>
2021-03-29 16:47:29 +02:00
Jay c0317b7453 Update README.md (#3707) 2021-03-29 16:43:29 +02:00
Daniel Lopretto f2057f77b2 Testing and cleanup of transformResponse (#3377)
- Tests for transformResponse
 - Remove eslint error by renaming the var
 - Test that there data a length to avoid JSON.parse headache
 - Use `util.isString()` over `typeof`

Co-authored-by: Jay <jasonsaayman@gmail.com>
2021-03-24 08:22:03 +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
Sasha Korotkov 62d6256039 issue#2609 | Sasha | predictable axios requests (#2702)
* issue#2609 | Sasha | predictable axios requests

- axios requests are not delayed by pre-emptive promise creation by default
- add options to interceptors api ("synchronous" and "runWhen")
- add documentation and unit tests

* issue#2609 | Sasha | pull request feedback changes

* issue#2609 | Sasha | additional feedback changes

* issue#2609 | Sasha | put back try/catch

* issue#2609 | Sasha | add 2 adapter unit tests

- remove check for requestCancelled

Co-authored-by: ak71845 <alexandre.korotkov@kroger.com>
Co-authored-by: Xianming Zhong <chinesedfan@qq.com>
Co-authored-by: Jay <jasonsaayman@gmail.com>
2021-03-01 11:11:35 +02:00
Nisar Hassan Naqvi 535d0c45c1 move the mention of gitpod to the main readme + modify gitpod description. (#2637)
Co-authored-by: Jay <jasonsaayman@gmail.com>
2021-02-17 08:28:00 +02:00
Ryota Ikezawa a6e3707fd4 Fixing a typographical error (#3567) 2021-02-15 21:47:28 +08:00
caikan 79979d9214 Removing duplicate functionality item in changelog (#3523)
Co-authored-by: Xianming Zhong <chinesedfan@qq.com>
2021-02-06 23:09:47 +08:00
Elina Gorshkova a250b00cd8 Fix grammar (#2642)
Fixed typos and grammatical errors.

Co-authored-by: Jay <jasonsaayman@gmail.com>
2021-02-05 07:52:45 +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
Xianming Zhong 9a4d7ac236 Fix the missing launcher (#3538)
Co-authored-by: Jay <jasonsaayman@gmail.com>
2021-01-29 08:34:49 +02:00
Ali Clark fe52a611ef Default headers example AUTH_TOKEN comment (#3539)
* Updating the 'Global axios defaults' README to use a safer example

The existing example usage it isn't safe in the general case as it can
lead to auth tokens being leaked to 3rd party endpoints by unexpectedly.

This change instead gives an example using
"axios.defaults.headers.common" to set the User-Agent, which is an
equally helpful use-case to document.

The 'Custom instance defaults' example just below the 'Global axios
defaults' example shows a method to set the 'Authorization' header
specific to a given API. I've also updated the variable in the 'Custom
instance defaults' code to use a semantically more relevant name within
that example.

* Revert the example instance name in response to PR request

* Reintroduce the Authorization example with a disclaimer about its usage

* Update wording nb -> important on usage comment

* Remove User-Agent example due to issues with this on Chrome and Safari

See https://github.com/axios/axios/issues/1231
Credit @chinesedfan for pointing this out
2021-01-12 16:52:42 +02:00
Daniel Lopretto 59ab559386 Update dev dependencies (#3401)
- Everything still works as expected.
  - Remove bundlesize
    - It still uses libtorb which is deprecated and broken on Win and
      requires a full suite of build tools on Mac. Keeping it in the
      package makes it difficult for anyone filing issues to run tests.
    - See: #3396
  - Update grunt and it's plugins
  - Update karma to v4...so much faster!
    - Changed the karma config. Better changes: #3394
  - Update Webpack
    - Uses terser over uglify
  - Update eslint
    - Caused an error in util.js from the `global` directive so the
      directive is removed (it was not needed).
  - Update typescript
    - The old version of tsc didn't know about new features in
      @types/node (like `asserts value`).

Co-authored-by: Jay <jasonsaayman@gmail.com>
2020-12-16 10:25:06 +02:00
Daniel Lopretto 8b0f373df0 Use different socket for Win32 test (#3375)
* Remove the skipping of the `socket` http test

* Use different socket path for Win32

 - See: https://github.com/nodejs/node-v0.x-archive/blob/master/test/simple/test-pipe-stream.js#L73
 - Also: https://github.com/nodejs/node-v0.x-archive/blob/master/test/common.js#L39

* Updating axios in types to be lower case (#2797)

Co-authored-by: Xianming Zhong <chinesedfan@qq.com>

Co-authored-by: Pilot <timemachine@ctrl-c.club>
Co-authored-by: Remco Haszing <remcohaszing@gmail.com>
Co-authored-by: Xianming Zhong <chinesedfan@qq.com>
Co-authored-by: Jay <jasonsaayman@gmail.com>
2020-12-09 13:04:58 +02:00
Jonathan Foster e426910be7 Protocol not parsed when setting proxy config from env vars (#3070)
* Fixing proxy protocol config when parsed from env vars

* Adding instructions to specify proxy protocol when setting proxy config

* Moved HTTPS proxy config instruction closer to example

* Clear https_proxy env var so as to not impact other tests
2020-12-03 09:36:50 +02:00
Daniel Lopretto c7329fefc8 Hotfix: Prevent SSRF (#3410)
* Reproducing the Vulnerability

* Prevent SSRF

* Cleanup

* Refactor to skip duplicate code

* Tests for correct passed data.

* Code review changes.
2020-11-24 08:44:00 +02:00
Jason Kwok f472e5da5f Adding a type guard for AxiosError (#2949)
Co-authored-by: Jason Kwok <JasonHK@users.noreply.github.com>
2020-11-03 10:01:07 +02:00
Daniel Lopretto 768825589f Remove the skipping of the socket http test (#3364)
Co-authored-by: Pilot <timemachine@ctrl-c.club>
2020-10-30 08:54:42 +02:00
Remco Haszing 820fe6e41a Updating axios in types to be lower case (#2797)
Co-authored-by: Xianming Zhong <chinesedfan@qq.com>
2020-10-27 20:36:32 +08:00
Emily Morehouse 94ca24b5b2 Releasing 0.21.0 2020-10-23 10:26:35 -06:00