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

40 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
Jay cc86c6c49f Fix/remove url required (#4426)
* Removed error when url is null as this breaks current use cases for alot of projects

* Removed associated tests that check for the for url to not be empty
2022-01-27 08:39:25 +02:00
Hirotaka Tagawa / wafuwafu13 95792908f0 Adding error handling when missing url (#3791)
* Fixing error message when missing url

* Fixing missing url

* Adding missing url case

* Update Axios.js

* Update requests.spec.js

* Update api.spec.js

* Update api.spec.js

* Update api.spec.js

Co-authored-by: Jay <jasonsaayman@gmail.com>
2021-12-23 10:53:40 +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
Kevin Kirsche 6d05b96dca Fix typos (#3309)
Fix typos
2020-10-03 12:25:07 -06:00
Xianming Zhong fa3673710e fix axios.delete ignores config.data (#3282)
Co-authored-by: Jay <jasonsaayman@gmail.com>
2020-10-01 09:46:32 +02:00
Tim Gates e8c6e19141 docs: Fix simple typo, existant -> existent (#3252) 2020-09-12 12:29:35 +08:00
Xianming Zhong 0d69a79c81 Refactor mergeConfig without utils.deepMerge (#2844)
* Adding failing test

* Fixing #2587 default custom config persisting

* Adding Concat keys and filter duplicates

* Fixed value from CPE

* update for review feedbacks

* no deepMerge

* only merge between plain objects

* fix rename

* always merge config by mergeConfig

* extract function mergeDeepProperties

* refactor mergeConfig with all keys, and add special logic for validateStatus

* add test for resetting headers

* add lots of tests and fix a bug

* should not inherit `data`

* use simple toString

* revert #1845

Co-authored-by: David Tanner <david.tanner@lifeomic.com>
Co-authored-by: Justin Beckwith <justin.beckwith@gmail.com>
2020-06-08 20:52:45 +02: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
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 33747ee8fb Remove usages of isOldIE in tests 2018-08-06 09:56:51 +02: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
mattridley 762044e453 Fixing #537 Rejecting promise if request is cancelled by the browser 2018-03-05 16:11:55 +00:00
Nick Uraltsev 26b06391f8 Update links 2017-09-28 21:09:47 -07:00
杨春旭 e4e32120ce Convert the method parameter to lowercase 2017-05-31 22:53:11 +08:00
Rubén Norte e0d59eb29b Adding failing tests that verify errors contain the request 2017-04-08 21:43:04 +02:00
Nick Uraltsev 36d97e525d Fixing broken test 2017-03-01 20:40:55 -08:00
Nick Uraltsev 46a9639ef2 Fixing sporadically failing tests 2016-10-29 21:58:06 -07:00
Matt Zabriskie 0578445929 Moar tests 2016-07-16 11:15:46 -06:00
Matt Zabriskie 98d489558e Transform response data on error
closes #378
2016-07-16 11:10:58 -06:00
Rubén Norte 157efd5615 Changing adapter signature to receive config and return promises 2016-07-09 21:30:16 +02:00
Rubén Norte 75f9b8c5fd Adding failing test for adapter errors 2016-07-07 16:04:37 +02:00
Nick Uraltsev 91dae3c4ad Improve error handling 2016-06-13 13:56:08 -07:00
Nick Uraltsev 2b8d89a65e Modifying isURLSearchParams function to use instanceof instead of duck typing 2016-05-18 18:47:34 -07:00
Nick Uraltsev f20490eb6b Adding support for URLSearchParams 2016-05-07 12:26:28 -07: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
Matt Zabriskie dcbb352262 Moving test helpers and auto-loading them 2016-03-07 13:21:27 -07:00
Matt Zabriskie dc07ef2559 Fixing tests for IE 2016-03-05 23:17:39 -07:00
Matt Zabriskie 371b82a2a0 Cleaning up tests a bit 2016-03-04 10:35:05 -07:00
Matt Zabriskie e7aa98f9f5 Improving tests in anticipation for saucelabs support 2016-03-03 22:44:16 -07:00
Matt Zabriskie d31ebc4c50 Normalize response status for HTTP 204 in MSIE 2016-01-22 14:40:44 -07:00
Philip Roberts 252876c2c0 Fixing reject not being called on xhr network errors.
Fixes #204
2016-01-22 16:39:41 +00:00
Vineet Hawal 44cccc450c add test case 2015-10-29 12:59:10 +05:30
Vineet Hawal a59bc8d2ae add xDomainRequest adapter 2015-10-29 12:51:37 +05:30
mzabriskie 219a1c29ab Supporting a fetch like API 2015-09-29 00:04:00 -06:00
mzabriskie 95f0f00c77 Fixing axios to treat single string argument as URL
closes #116
2015-09-28 18:40:20 -06:00
mzabriskie 3c4dfe8a81 Making content-type header case insensitive
closes #89
2015-07-23 09:39:59 -07:00
mzabriskie 1629a026da Adding X-Requested-With header 2015-04-12 16:07:32 -06:00