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

106 Commits

Author SHA1 Message Date
João Gabriel Quaresma 195c8e5ff5 Returned error treated when requesting uncommon URL (#3544)
* Fixing error returned when requesting illegal URL

* Adding unit tests http.js

* Fixing error message axios invalid request from browser

* Adding unit tests requests.spec.js

* Adding at utils.js a new method: getProtocol

Co-authored-by: Jay <jasonsaayman@gmail.com>
2022-03-07 19:53:57 +02:00
Dmitriy Mozgovoy 170588f3d7 Refactored project file structure to avoid circular imports; (#4220)
Co-authored-by: Jay <jasonsaayman@gmail.com>
2022-03-07 09:09:43 +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
Dobes Vandermeer 96956e30ba Improve timeout error when timeout is browser default (#3209)
I seems like the browser imposes a default timeout despite the documented default timeout being "never".  When this timeout occurs, axios confusingly reports an error "timeout of 0ms exceeded".  This change the message to avoid the confusing "0ms" part.

Co-authored-by: Jay <jasonsaayman@gmail.com>
2021-09-16 21:16:43 +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
George Cheng 9a78465a92 Revert "Fixing overwrite Blob/File type as Content-Type in browser. (#1773)" (#3289)
This reverts commit f3cc053fb9.
2020-10-13 10:19:37 +02:00
Allan Cruz 04d45f2091 Fixing requestHeaders.Authorization (#3287) 2020-09-20 10:19:48 +08:00
George Cheng f3cc053fb9 Fixing overwrite Blob/File type as Content-Type in browser. (#1773)
Co-authored-by: Jay <jasonsaayman@gmail.com>
2020-05-28 21:28:40 +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
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
ZhaoXC dc4bc49673 fix: fix ignore set withCredentials false (#2582) 2019-12-08 23:52:45 -08:00
IVLIU 6284abfa06 custom timeout prompt copy (#2275)
* style: ui

* feat: custom timeout txtx

* feat: custom timeout txtx
2019-10-15 22:29:16 -03:00
multicolaure 6fe506fda2 Do not modify config.url when using a relative baseURL (resolves #1628) (#2391)
* Adding tests to show config.url mutation

Because config.url is modified while processing the request
when the baseURL is set,
it is impossible to perform a retry with the provided config object.

Ref #1628

* Fixing url combining without modifying config.url

As config.url is not modified anymore during the request processing.
The request can safely be retried after it failed with the provided
config.

resolves #1628
2019-09-05 12:43:55 -03:00
Rikki Gibson a9831131c3 Remove HTTP 1223 handling
The 1223 error was fixed in IE 10. See https://blogs.msdn.microsoft.com/ieinternals/2012/03/01/internet-explorer-10-consumer-preview-minor-changes-list/
2018-08-06 09:56:51 +02:00
Rikki Gibson 5c754e6e07 Remove ie8/9 special CORS treatment and btoa polyfill 2018-08-06 09:56:51 +02:00
Justin Beckwith 22c2baf205 chore: upgrade eslint and add fix command 2018-04-06 21:50:26 -07:00
mattridley 762044e453 Fixing #537 Rejecting promise if request is cancelled by the browser 2018-03-05 16:11:55 +00:00
Nick Uraltsev b7d8d126da Removing unnecessary condition 2017-11-11 15:09:02 -08:00
Andrew J. Pierce 468e90993d Move window defined check before window.XMLHttpRequest check 2017-11-02 18:57:12 -04:00
Nick Uraltsev 26b06391f8 Update links 2017-09-28 21:09:47 -07:00
ibci e8edb1e29a Update xhr.js 2017-06-27 13:20:45 -07:00
Rubén Norte 22ce6db383 Adding request to error objects when it is available 2017-04-08 21:44:15 +02:00
Nick Uraltsev b053f4b1b9 Fixing typo 2017-03-01 22:54:44 -08:00
Itaru Kitagawa 142bce1fb0 See config.responseType instead of request.responseType when suprressing DOMException 2017-01-16 14:28:38 +09:00
Nick Uraltsev 417913bf8b Fixing issue with btoa and IE 2016-10-28 21:19:27 -07:00
Nick Uraltsev 3fcf54ff36 Fixing issue with calling cancel after response has been received 2016-10-17 18:20:13 -07:00
Nick Uraltsev 72dd897bb5 Adding cancellation support 2016-09-17 11:52:56 -07:00
Nick Uraltsev 436d14b976 Fixing issue with responseURL property
`responseURL` is not supported in IE
2016-09-12 11:38:28 -07:00
kenvunz 8813068958 Add exception for file protocol request
Without this patch, it's not possible using `axios` for fetching local content for `cordova/phonegap` applications
2016-09-08 12:49:11 +07:00
Dylan Lundy 63f41b53aa Splitting progress event handlers into upload and download handlers 2016-08-22 21:52:59 -07:00
Marco Pracucci 85b9015890 Fixing xsrf header on missing xsrfCookieName 2016-08-08 14:31:11 +02:00
Rubén Norte 157efd5615 Changing adapter signature to receive config and return promises 2016-07-09 21:30:16 +02:00
Matt Zabriskie 10eb238651 Move transform response logic from adapters to dispatcher 2016-06-23 15:11:35 -06:00
Matt Zabriskie 7a12f36602 Only use if it's a function 2016-06-23 13:59:03 -06:00
Nick Uraltsev 91dae3c4ad Improve error handling 2016-06-13 13:56:08 -07:00
Matt Zabriskie 203cbc2da0 Moving settle & transformData from helpers/ -> core/ 2016-06-01 13:54:38 -06:00
stevenp f32b5a6ce4 Only set empty handlers for IE CORS support if using XDomainRequest 2016-05-04 00:24:18 -05:00
Matt Zabriskie aeac3e132e Merge pull request #299 from nickuraltsev/array-buffer-fix
Fixing issue with ArrayBuffer
2016-04-26 14:25:19 -06: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
Nick Uraltsev 4d83ba91f5 Fix issue with ArrayBuffer 2016-04-18 11:22:11 -07:00
Nick Uraltsev a913ea56c1 Merge pull request #200 from AurelioDeRosa/patch-1
Expose XHR instance
2016-03-31 20:08:58 -07:00
Deamon87 8972ea5208 Fixing xhr.js for WebWorker env
More fixes.
2016-03-29 03:09:15 +03:00
Deamon87 aaca1244eb Fix xhr for webworker env
Fix xhr for webworker env
2016-03-29 02:43:51 +03:00
Matt Zabriskie 4d2f9c21d4 Gettings tests passing for IE9 2016-03-09 16:17:10 -07:00
Matt Zabriskie 0da38da921 A bit of code cleanup 2016-03-07 10:50:46 -07:00
Aurelio De Rosa ab361ac169 Expose XHR instance
Fixes gh-64
2016-03-06 12:25:33 +00:00
Matt Zabriskie 5fc59a65aa Resolving merge conflicts 2016-03-05 23:56:02 -07:00
Matt Zabriskie 84755d1325 Merge pull request #251 from ruchigoyal2005/master
IE9 fix for cross domain calls
2016-03-05 23:40:13 -07:00
Matt Zabriskie 3c2594292a Merge pull request #249 from ctimmerm/ie8-onreadystatechange
Fixing IE8 support by bringing back onreadystatechange
2016-03-05 23:35:10 -07:00