Skip to content

Commit

Permalink
Revert "Fixing default transformRequest with buffer pools (#1511)" (#…
Browse files Browse the repository at this point in the history
…2982)

This reverts commit a9a3b5e.
  • Loading branch information
jasonsaayman committed May 27, 2020
1 parent d35b5b5 commit f2b478f
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 7 deletions.
2 changes: 1 addition & 1 deletion lib/defaults.js
Expand Up @@ -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');
Expand Down
6 changes: 0 additions & 6 deletions test/specs/defaults.spec.js
Expand Up @@ -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"}');

Expand Down

0 comments on commit f2b478f

Please sign in to comment.