Skip to content

Commit

Permalink
Feat/json improvements (#3763)
Browse files Browse the repository at this point in the history
* 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;
  • Loading branch information
DigitalBrainJS committed Apr 19, 2021
1 parent 5ad6994 commit 7821ed2
Showing 1 changed file with 0 additions and 1 deletion.
1 change: 0 additions & 1 deletion test/specs/transform.spec.js
Expand Up @@ -64,7 +64,6 @@ describe('transform', function () {
setTimeout(function () {
expect(thrown).toBeTruthy();
expect(thrown.name).toContain('SyntaxError');
expect(thrown.message).toContain('JSON');
done();
}, 100);
});
Expand Down

0 comments on commit 7821ed2

Please sign in to comment.