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

38 Commits

Author SHA1 Message Date
Jay d660e29c1a Revert "Fixed isFormData predicate; (#4413)" (#4472)
This reverts commit 73e3bdb883.
2022-02-13 15:47:38 +02:00
Dmitriy Mozgovoy 73e3bdb883 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 through `form-data` package;
2022-02-02 13:48:44 +02:00
Ben Carp 99648153ce toFormData helper function (#3757)
* adding toFormData test

* adding toFormData

Co-authored-by: Jay <jasonsaayman@gmail.com>
2021-12-23 10:21:51 +02:00
Black-Hole 6fca6a7027 refactor(helpers): optimize the logic of isAxiosError (#3546)
1. add the judgment of null

Co-authored-by: Jay <jasonsaayman@gmail.com>
2021-12-22 21:09:33 +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
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
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
rockcs1992 36f0ad2f98 Replace 'blacklist' with 'blocklist' (#3006) 2020-06-10 13:47:31 -06: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
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
Yasu Flores 841466416b Fix XSS logic that matched some valid urls (#2529)
* Fix XSS logic that matched some valid urls, e.g. "/one/?foo=bar", when it shouldn't match those
2019-11-07 18:39:24 -08:00
Yasu Flores 494d817314 Change syntax to see if build passes (#2488)
* Change syntax to see if build passes

* Test commit

* Test with node 10

* Test adding all browsers in travis

* remove other browsers when running on travis
2019-10-25 11:25:53 -03:00
Yasu Flores 29da6b24db Fix to prevent XSS, throw an error when the URL contains a JS script (#2464)
* Fixes issue where XSS scripts attacks were possible via the URL

* Fix error

* Move throwing error up

* Add specs and make regex cover more xss cases
2019-10-16 07:53:10 -03:00
Wataru 19969b4fbd Fixing Vulnerability A Fortify Scan finds a critical Cross-Site Scrip… (#2451)
* Fixing Vulnerability A Fortify Scan finds a critical Cross-Site Scripting

* use var insted of const
2019-10-08 21:23:34 -03:00
Anatoly Ryabov 81eaa3db4c Fixing building url with hash mark (#1771)
This commit fix building url with hash map (fragment identifier) when parameters are present: they must not be added after `#`, because client cut everything after `#`
2018-09-04 09:53:57 +02:00
Rikki Gibson 1c2881cbe6 Remove btoa polyfill tests 2018-08-06 09:56:51 +02:00
Nick Uraltsev 26b06391f8 Update links 2017-09-28 21:09:47 -07:00
Tyler Brown fb08e95603 Duplicate header handling (#874)
* Update parseHeaders to match node http behavior

Node ignores duplicate entries for certain HTTP headers.

It also always converts the `set-cookie` header into an array.

* add tests for new duplicate header handling

* clarify comment
2017-08-12 14:58:10 +02:00
Lochlan Bunn fe7d09bb08 Fixing combineURLs to support an empty relativeURL (#581)
* Fixing combineURLs to support an empty relativeURL

When combining the base and relative URLs, we should forego force
appending a slash to the base when the relative URL is empty.
This leads to a semantic url.

* Fixing combineURLs, allowing single slash relatives
2016-12-07 21:23:45 -08:00
Matt Zabriskie 203cbc2da0 Moving settle & transformData from helpers/ -> core/ 2016-06-01 13:54:38 -06:00
Nick Uraltsev f20490eb6b Adding support for URLSearchParams 2016-05-07 12:26:28 -07:00
Nick Uraltsev fa9444e0ba Allow custom HTTP status code error ranges (#308)
Adding support for custom HTTP status code error ranges
2016-04-26 14:18:58 -06:00
Matt Zabriskie dcbb352262 Moving test helpers and auto-loading them 2016-03-07 13:21:27 -07:00
Matt Zabriskie 7041775943 Changing btoa ponyfill to improve testing 2016-03-03 22:43:16 -07:00
Matt Zabriskie 2b147fb0b7 Moving bind into it's own file 2015-12-14 20:06:16 -07:00
Matt Zabriskie 9ede644b98 Better tests for btoa 2015-12-14 12:16:57 -07:00
Nick Uraltsev 20a25a2783 Add isAbsoluteURL helper 2015-11-21 19:29:53 -08:00
Nick Uraltsev e253b0ef3e Add combineURLs helper 2015-11-21 17:41:02 -08:00
Matt Zabriskie d1940f52bc Restoring buildURL tests 2015-11-20 11:37:41 -07:00
Matt Zabriskie b1d9194622 Fixing file system case issue 2015-11-20 11:36:50 -07:00
Matt Zabriskie 3d65057d71 Making isURLSameOrigin/cookies safe to use in all envs 2015-11-19 15:18:47 -07:00
David Fournier 14ede9e18e Add support third-party library to serialize url params 2015-10-27 11:54:44 +01:00
Jeffrey Horn a130e787c3 return result from callback
returning the result of the callback allows you to chain the promise
like you would expect
2015-09-02 10:43:27 -07:00
Matt Zabriskie 3b10b6a6c5 Merge pull request #49 from maxhoffmann/master
Fixing arrays in get params
2015-07-23 09:08:16 -07:00
Maximilian Hoffmann f44597e38b don’t escape square brackets 2015-07-23 10:46:21 +02:00
Andrew Gibb 4f1101fe4b Fixing isArrayLike to allow length as a param. Added test 2015-07-21 14:29:24 +10:00
Maximilian Hoffmann 594df987f2 fix array params 2015-05-27 13:32:34 +02:00
mzabriskie fc12b933f7 Moving many nodeunit tests to jasmine 2015-03-18 17:12:51 -06:00