1. 15 3月, 2022 1 次提交
    • D
      Improved FormData support; (#4448) · 6b9b05b9
      Dmitriy Mozgovoy 提交于
      * Fixed isFormData predicate;
      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;
      
      * Added the `form-data` package as a dependency for the server build;
      Added tests for FormData payload;
      
      * Added FormData automatic serialization section;
      Refactored cancellation section;
      
      * Reworked toFormData helper;
      Expose toFormData helper as a static method;
      Refactored transform request;
      Added kindOf, kindOfTest, endsWith, isTypedArray util;
      Refactored utils.js to use kindOf for tests;
      
      * 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 using `form-data` package;
      
      (cherry picked from commit 73e3bdb8)
      
      * Added shortcut methods `postForm`, `putForm`, `patchForm` to submit a Form;
      Added ability to submit FileList object as a FormData;
      Updated README.md;
      
      * Updated README.md;
      6b9b05b9
  2. 11 3月, 2022 1 次提交
  3. 08 3月, 2022 3 次提交
  4. 07 3月, 2022 1 次提交
  5. 13 2月, 2022 1 次提交
  6. 02 2月, 2022 1 次提交
    • D
      Fixed isFormData predicate; (#4413) · 73e3bdb8
      Dmitriy Mozgovoy 提交于
      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;
      73e3bdb8
  7. 27 1月, 2022 1 次提交
    • J
      Fix/remove url required (#4426) · cc86c6c4
      Jay 提交于
      * 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
      cc86c6c4
  8. 19 1月, 2022 2 次提交
  9. 18 1月, 2022 1 次提交
  10. 23 12月, 2021 5 次提交
    • H
      Adding error handling when missing url (#3791) · 95792908
      Hirotaka Tagawa / wafuwafu13 提交于
      * 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: NJay <jasonsaayman@gmail.com>
      95792908
    • B
      toFormData helper function (#3757) · 99648153
      Ben Carp 提交于
      * adding toFormData test
      
      * adding toFormData
      Co-authored-by: NJay <jasonsaayman@gmail.com>
      99648153
    • P
      Fixing maxBodyLength enforcement (#3786) · c00c4ddd
      Paulo Renato 提交于
      * 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: NJay <jasonsaayman@gmail.com>
      c00c4ddd
    • W
      (Add tests to) document how multiple inceptors work (#3564) · e6aef5a1
      Wolfram Kriesing 提交于
      * 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: NJay <jasonsaayman@gmail.com>
      e6aef5a1
    • B
      refactor(helpers): optimize the logic of isAxiosError (#3546) · 6fca6a70
      Black-Hole 提交于
      1. add the judgment of null
      Co-authored-by: NJay <jasonsaayman@gmail.com>
      6fca6a70
  11. 29 10月, 2021 1 次提交
  12. 22 10月, 2021 1 次提交
  13. 15 10月, 2021 1 次提交
  14. 12 10月, 2021 1 次提交
    • R
      Test types (#4140) · 94a93447
      Remco Haszing 提交于
      * Distinguish request and response data types
      
      * Fix Axios headers type
      
      `axios.headers` is not of the same type as `request.headers`, so a new type
      `AxiosDefaults` was introduced
      
      * Replace grunt-ts with dtslint
      
      This asserts that the type definitions are valid in the specified TypeScript
      version and above. This is the same tool that is used by DefinitelyTyped.
      
      * Remove grunt-ts
      
      * Restore typescript dependency
      
      * Fix missing semicolons
      Co-authored-by: NClaas Augner <github@caugner.de>
      Co-authored-by: NJay <jasonsaayman@gmail.com>
      94a93447
  15. 01 10月, 2021 1 次提交
    • J
      Release/v0.22.0 (#4107) · 76f09afc
      Jay 提交于
      * 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: NJay <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: NJay <jasonsaayman@gmail.com>
      
      * Prepping v0.22.0 for release
      
      * Updated date
      Co-authored-by: NDmitriy Mozgovoy <robotshara@gmail.com>
      76f09afc
  16. 08 9月, 2021 1 次提交
    • M
      Caseless header comparing in HTTP adapter. (#2880) · f3ca6371
      Matt R. Wilson 提交于
      * Caseless header comparing in HTTP adapter.
      
      It was adding User-Agent and removing Authorization, but only when
      existing headers had the exact right casing. Node uses caseless logic
      when managing headers.
      
      This was causing some requests to have `User-Agent` appended to the
      headers object and overriding provided agent strings.
      
      Also included is an update to not override the `Content-Length` if it
      was already defined in the options. It can be desirable to manually
      specify a content length that does not match the data on hand.
      Especially for testing.
      
      * Fix eslint error
      
      * fixup: update state UA logic
      
      Play nice with https://github.com/axios/axios/pull/3703Co-authored-by: NJay <jasonsaayman@gmail.com>
      f3ca6371
  17. 06 9月, 2021 1 次提交
  18. 05 9月, 2021 4 次提交
  19. 21 5月, 2021 1 次提交
  20. 06 5月, 2021 1 次提交
  21. 20 4月, 2021 2 次提交
    • D
      Feat/json improvements (#3763) · 7821ed20
      Dmitriy Mozgovoy 提交于
      * 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;
      7821ed20
    • D
      JSON improvements: throw if JSON parsing failed; number, boolean can be passed... · 5ad6994d
      Dmitriy Mozgovoy 提交于
      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);
      5ad6994d
  22. 18 4月, 2021 1 次提交
  23. 29 3月, 2021 1 次提交
  24. 24 3月, 2021 1 次提交
  25. 01 3月, 2021 1 次提交
  26. 09 12月, 2020 1 次提交
  27. 03 12月, 2020 1 次提交
  28. 24 11月, 2020 1 次提交
    • D
      Hotfix: Prevent SSRF (#3410) · c7329fef
      Daniel Lopretto 提交于
      * Reproducing the Vulnerability
      
      * Prevent SSRF
      
      * Cleanup
      
      * Refactor to skip duplicate code
      
      * Tests for correct passed data.
      
      * Code review changes.
      c7329fef
  29. 03 11月, 2020 1 次提交