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

Revert "Fixing default transformRequest with buffer pools (#1511)" (#2982)

This reverts commit a9a3b5e22b.
This commit is contained in:
Jay
2020-05-27 20:05:26 +02:00
committed by GitHub
parent d35b5b5902
commit f2b478f7ff
2 changed files with 1 additions and 7 deletions
+1 -1
View File
@@ -41,7 +41,7 @@ var defaults = {
return data;
}
if (utils.isArrayBufferView(data)) {
return data.slice().buffer;
return data.buffer;
}
if (utils.isURLSearchParams(data)) {
setContentTypeIfUnset(headers, 'application/x-www-form-urlencoded;charset=utf-8');
-6
View File
@@ -24,12 +24,6 @@ describe('defaults', function () {
expect(defaults.transformRequest[0]('foo=bar')).toEqual('foo=bar');
});
it('should transform TypedArrays without including buffer pool', function () {
if (typeof Uint8Array === 'undefined') return this.skip();
const buffered = new Uint8Array(256).subarray(10, 26);
expect(defaults.transformRequest[0](buffered).byteLength).toEqual(16);
});
it('should transform response json', function () {
var data = defaults.transformResponse[0]('{"foo":"bar"}');