* 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>
* 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>
* 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>
* 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>
* 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/3703
Co-authored-by: Jay <jasonsaayman@gmail.com>
* 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);
* Adding ability to omit User-Agent header
* Update line to be more compact
* Add unit tests for user-agent cases
Co-authored-by: Jay <jasonsaayman@gmail.com>
- Tests for transformResponse
- Remove eslint error by renaming the var
- Test that there data a length to avoid JSON.parse headache
- Use `util.isString()` over `typeof`
Co-authored-by: Jay <jasonsaayman@gmail.com>
* Fixing proxy protocol config when parsed from env vars
* Adding instructions to specify proxy protocol when setting proxy config
* Moved HTTPS proxy config instruction closer to example
* Clear https_proxy env var so as to not impact other tests
* Adding ability to disable auto decompression
* Updating decompress documentation in README
* Fixing test\unit\adapters\http.js lint errors
* Adding test for disabling auto decompression
* Removing changes that fixed lint errors in tests
* Removing formating change to unit test
Co-authored-by: Xianming Zhong <chinesedfan@qq.com>
* 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
Resolves#1158
This modifies http.js to uppercase the HTTP method, similar to xhr.js, before passing the request off to the transport. This causes follow-redirects to preserve the HTTP method when automatically making a request to the next URL.
* Adding support for no_proxy env variable
* Adds support for the no_proxy environment variable commonly available
with programs supporting the http_proxy/https_proxy environment
variables.
* Adds tests to test the no_proxy environment variable.
* Adding documentation for the proxy env variables
* Adds documentation to README.md for the supported, conventional
http_proxy, https_proxy, and no_proxy environment variables.
* Adding a way to disable all proxy processing
When the proxy field in configuration is === false all proxy processing is
disabled. This specifically disable the 'http_proxy' environment variable
handling.
Fixes#635
Related to #434
* Change readme wording
From review comment on PR (#691)