2
0
mirror of https://github.com/tenrok/axios.git synced 2026-05-15 11:59:42 +03:00
Commit Graph

1102 Commits

Author SHA1 Message Date
Jay b736acfa19 Update FUNDING.yml 2022-03-11 19:23:12 +02:00
Jay e52e4dbb57 Fixed errors when running tests 2022-03-10 21:25:55 +02:00
Jay 80387424e4 Removed all old error classes 2022-03-10 08:30:59 +02:00
Jay 340ad9ec8c Fixed merge conflict 2022-03-09 19:57:04 +02:00
Jay d8d43c1ffd Mended merge conflicts 2022-03-09 19:41:56 +02:00
Jay 9497729537 Feat/circular deps (#4515) (#4516)
* Refactored project file structure to avoid circular imports;

* Bump url-parse from 1.5.4 to 1.5.10 (#4501)

Bumps [url-parse](https://github.com/unshiftio/url-parse) from 1.5.4 to 1.5.10.
- [Release notes](https://github.com/unshiftio/url-parse/releases)
- [Commits](https://github.com/unshiftio/url-parse/compare/1.5.4...1.5.10)

---
updated-dependencies:
- dependency-name: url-parse
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

Co-authored-by: DigitalBrainJS <robotshara@gmail.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

Co-authored-by: DigitalBrainJS <robotshara@gmail.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-03-09 19:24:32 +02:00
Rijk van Zanten 8e67551177 Update line on methods, update TS definition to allow strings (#3802)
Fixes #3140

Co-authored-by: Jay <jasonsaayman@gmail.com>
2022-03-08 08:26:07 +02:00
Tommaso Madonia 224ed940e1 Add AxiosInterceptorOptions to d.ts (#3800)
Co-authored-by: Jay <jasonsaayman@gmail.com>
2022-03-07 20:26:50 +02:00
sakarit bdb7d76d40 Adding baseURL to be used in getUri(), also removing question mark trimming since there seems to be no obvious reason for it. (#3737)
Co-authored-by: Jay <jasonsaayman@gmail.com>
2022-03-07 20:09:23 +02:00
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
Zoran Kokeza 412d3bd607 Adding support for beforeRedirect config option (#3852)
* Adding support for beforeRedirect config option

* Adding tests for beforeRedirect

* Update README.md

Co-authored-by: Prabodh Meshram <prabodh.meshram7@gmail.com>

* fix types

Co-authored-by: Prabodh Meshram <prabodh.meshram7@gmail.com>
Co-authored-by: Jay <jasonsaayman@gmail.com>
2022-03-07 19:46:08 +02:00
Nicholas Juntilla 3d13b67c56 Fix FormData example (#4391)
You need to have form.getBuffer() in order for the FormData library to submit from node.

Co-authored-by: Jay <jasonsaayman@gmail.com>
2022-03-07 09:45:12 +02:00
Tomás Raiti 45cb5ad716 Updated README example to be coherent with the CommonJS usage (#4418)
Co-authored-by: Jay <jasonsaayman@gmail.com>
2022-03-07 09:35:48 +02:00
dependabot[bot] 2396fcd7e9 Bump karma from 6.3.14 to 6.3.16 (#4506)
Bumps [karma](https://github.com/karma-runner/karma) from 6.3.14 to 6.3.16.
- [Release notes](https://github.com/karma-runner/karma/releases)
- [Changelog](https://github.com/karma-runner/karma/blob/master/CHANGELOG.md)
- [Commits](https://github.com/karma-runner/karma/compare/v6.3.14...v6.3.16)

---
updated-dependencies:
- dependency-name: karma
  dependency-type: direct:development
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Jay <jasonsaayman@gmail.com>
2022-03-07 09:13:50 +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
dependabot[bot] 6e63edf455 Bump url-parse from 1.5.4 to 1.5.10 (#4501)
Bumps [url-parse](https://github.com/unshiftio/url-parse) from 1.5.4 to 1.5.10.
- [Release notes](https://github.com/unshiftio/url-parse/releases)
- [Commits](https://github.com/unshiftio/url-parse/compare/1.5.4...1.5.10)

---
updated-dependencies:
- dependency-name: url-parse
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-02-28 09:38:31 +02:00
Jay c9aca75257 Releasing v0.26.0 2022-02-13 16:20:24 +02:00
Jay 3f842e034e Merge branch 'master' of github.com:axios/axios 2022-02-13 15:57:46 +02:00
Jay 2f1e8189f2 Merge branch 'cookieMr-master' 2022-02-13 15:56:50 +02:00
Jay 95295f6f29 Fixed conflict in package lock 2022-02-13 15:55:42 +02:00
dependabot[bot] b3aa79e138 Bump follow-redirects from 1.14.7 to 1.14.8 (#4473)
Bumps [follow-redirects](https://github.com/follow-redirects/follow-redirects) from 1.14.7 to 1.14.8.
- [Release notes](https://github.com/follow-redirects/follow-redirects/releases)
- [Commits](https://github.com/follow-redirects/follow-redirects/compare/v1.14.7...v1.14.8)

---
updated-dependencies:
- dependency-name: follow-redirects
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Jay <jasonsaayman@gmail.com>
2022-02-13 15:50:07 +02:00
Jay d660e29c1a Revert "Fixed isFormData predicate; (#4413)" (#4472)
This reverts commit 73e3bdb883.
2022-02-13 15:47:38 +02:00
dependabot[bot] 447a24dfc3 Bump karma from 6.3.11 to 6.3.14 (#4461)
Bumps [karma](https://github.com/karma-runner/karma) from 6.3.11 to 6.3.14.
- [Release notes](https://github.com/karma-runner/karma/releases)
- [Changelog](https://github.com/karma-runner/karma/blob/master/CHANGELOG.md)
- [Commits](https://github.com/karma-runner/karma/compare/v6.3.11...v6.3.14)

---
updated-dependencies:
- dependency-name: karma
  dependency-type: direct:development
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-02-13 15:45:14 +02:00
CookieMr c5bdbd436d Update follow-redirects dependency due to Vurnerbility
Previous version of follow-redirects dependency is reported
by Snyk to have a vurnerbility.
https://app.snyk.io/test/npm/follow-redirects/1.14.7
2022-02-11 14:58:12 +01: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
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
Daniel 1163588aa2 Added errors to be displayed when the query parsing process itself fails. (#3961)
* Adding errors when the query parsing process fails

* Updated error

* Removed unused variables

Co-authored-by: Jay <jasonsaayman@gmail.com>
2022-01-18 18:50:33 +02:00
duibu05 4461761fcb Fixed The timeoutErrorMessage property in config not work with Node.js (fixes #3580) (#3581)
* The timeoutErrorMessage property in config not work with Node.js (#3580)

* Adding "should respect the timeoutErrorMessage property" test case

Co-authored-by: Will Loo <duibu05@126.com>

* The timeoutErrorMessage property in config not work with Node.js (#3580)

* Fixing The timeoutErrorMessage property in config not work with Node.js (#3580)

* Updating http adapter

* Adding reject config.timeoutErrorMessage when setup

Co-authored-by: Will Loo <duibu05@126.com>

* Fixing The timeoutErrorMessage property in config not work with Node.js (#3580)

* Fixing The timeoutErrorMessage property in config not work with Node.js (#3580)

* Update http adapter

* Make changes as suggested after code review

Co-authored-by: Will Loo <duibu05@126.com>

Co-authored-by: Jay <jasonsaayman@gmail.com>
2022-01-18 18:40:18 +02:00
Jay 5c5cbdf4ba Removed cancel token request test till debugging on FireFox can be done 2022-01-18 09:24:55 +02:00
Jay 63dfce85ab Releasing v0.25 2022-01-18 09:13:27 +02:00
Jay dccaeb1b68 Updated changelog for release 2022-01-18 09:06:19 +02:00
Gustavo Sales 51f3ccb08e Updating follow-redirects with security updates (#4379)
Co-authored-by: Gustavo Sales <gustavo@blastradius.ai>
2022-01-13 07:56:28 +02:00
Brian Adams ccc9516af8 Fixing removing package-lock from gitignore (#4346)
Co-authored-by: Jay <jasonsaayman@gmail.com>
2021-12-29 07:30:54 +02:00
Daniel ea0d9c69f7 Adding error handling inside stream end callback (#3967)
* Adding error handling inside end callback  for response streams

* Updating error handling in stream end callback

* Update http.js

Co-authored-by: Jay <jasonsaayman@gmail.com>
2021-12-23 19:28:10 +02:00
Felipe Carvalho 4fbf61dc75 Adding responseEncoding prop type in AxiosRequestConfig (#3918)
* Adding responseEncoding prop type in AxiosRequestConfig

* Update index.d.ts

Co-authored-by: Jay <jasonsaayman@gmail.com>
2021-12-23 19:07:46 +02:00
C. Lewis a76571abec Use native Array.isArray() in utils.js (#3836)
Co-authored-by: Jay <jasonsaayman@gmail.com>
2021-12-23 18:45:44 +02:00
狼族小狈 a8cd75a081 Update isAbsoluteURL.js (#3809)
Escaping non-special characters in strings, template literals, and regular expressions doesn't have any effect, as demonstrated in the following example:

https://eslint.org/docs/rules/no-useless-escape

Co-authored-by: Jay <jasonsaayman@gmail.com>
2021-12-23 13:33:16 +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
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
Paulo Renato c00c4ddd87 Fixing maxBodyLength enforcement (#3786)
* Adding request body length validation on HTTP adapter

* Removing error code assertion on HTTP's body length support test

 * Removed due to the error being thrown by axios itself now, instead of follow-redirects

Co-authored-by: Jay <jasonsaayman@gmail.com>
2021-12-23 10:19:02 +02:00
Andrew Ovens 962f9ab712 Update upgrade guide for https proxy setting (#3604)
Co-authored-by: Jay <jasonsaayman@gmail.com>
2021-12-22 21:21:03 +02:00
Wolfram Kriesing e6aef5a1c4 (Add tests to) document how multiple inceptors work (#3564)
* Add a group for the multiple-interceptors tests.

The current test contains a lot of details that are worth being tested
separately and also made explicit. This is what is coming with the next changes.

* Fix indentation.

* Make explicit that the test only tests the interception of the fulfilled part.

* Indent.

* Make the test just test a tiny bit, as described.

The more explicit the test, the better we can 1) describe what it does
and use that for the docs to make them understandable 2) have a better
explicit description of the API (in case we want to modify it) and 3) have
a regression test when changing.

* Add a test that explicitly shows that the order of interceptors is as they were added.

* Pull out reusable code, to make the tests more explicitly stating the things they care about.

* Write a test showing that the responses are not merged or anything,
only the last one in the chain is returned.

* Make visible that the interceptors are a chain, one receives its predecessor's data.

* Test what happens when the interceptor throws.

* Refactor, add another group of tests and pull helper function there.

The previous change to also catch in the helper function was not needed
for any of the tests above, so remove it and put it in the describe-block
below where it is needed.
Just trying to write the specific code needed, not more.
Not sure about the impact for failing tests, I am glad about input.
But the main intention here is to have minimal code, explicit tests and
not too much generic code which might break itself eventually.

* Documenting that the following reject-interceptor gets called.

* Documenting how the interceptor chain handles caught rejections.

* Document "multiple interceptors".

I just extracted the test descriptions from the new/modified tests.
And I also learned that I should improve the test descriptions, the
tests are just in a GIVEN-WHEN-THEN structure, so I can also use those
terms better. Will do this next.

* Transfer the better readable descriptions as I changed them in the README back into the tests.

After I had updated the README using the test descriptions I realized how
the test descriptions can be improved, so I did this "moving" the learnings
back into the code.

* Be a bit more explicit, it was not clear when reading, imho.

* Add new lines to be kinda consistent with the rest of the file.

Co-authored-by: Jay <jasonsaayman@gmail.com>
2021-12-22 21:14:52 +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
Black-Hole 476ee88442 chore: ignore yarn.lock file (#3545)
Co-authored-by: Jay <jasonsaayman@gmail.com>
2021-12-22 21:06:36 +02:00
Remco Haszing 4c8b02de94 Adding axios-test-instance to ecosystem (#3496)
`axios-test-instance` is a package that allows users to write tests for NodeJS
servers using Axios.

Co-authored-by: Jay <jasonsaayman@gmail.com>
2021-12-22 21:00:46 +02:00
Emil Broman cd1b82bb76 Removing code relying on strict mode behaviour for arguments (#3470)
Co-authored-by: Jay <jasonsaayman@gmail.com>
2021-12-22 20:58:12 +02:00
Doowonee 55e6577b75 Adding a socket handler for keep TCP connection (#3422)
This is not http keepalive option it is TCP level
which is lower than HTTP.

It will send meanless ack flag packet to server.
so it woudn't be drop TCP connection by server side
like Firewall, Loadbalancer, Nginx etc.

Co-authored-by: Jay <jasonsaayman@gmail.com>
2021-12-22 20:56:14 +02:00
Andrey Pechkurov ebedf6b653 Avoid unnecessary Buffer allocations (#3321) 2021-12-22 20:50:05 +02:00
enofan 716d5def2f Update utils.js (#3342)
update isFormdata,isArrayBuffer and isURLSearchParams, because value and Formdata(ArrayBuffer or URLSearchParams) are not the same Window sometimes.

Co-authored-by: Jay <jasonsaayman@gmail.com>
2021-12-22 20:37:27 +02:00
Stefano Magni 5431634fab Fixing Cancel' signature. (#3152) (#3153)
Co-authored-by: Jay <jasonsaayman@gmail.com>
2021-12-22 20:30:50 +02:00