We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
new Response(new Uint8Array([8])).arrayBuffer();
returns a Promise, which resolves to a Uint8Array. It should resolve to an ArrayBuffer instead.
Uint8Array
ArrayBuffer
Steps to reproduce: Load this polyfill and paste above code into the developer console.
My hacky workaround:
After loading the polyfill add the following:
const ori = window.Response.prototype.arrayBuffer; window.Response.prototype.arrayBuffer = function (...props) { return (ori.apply(this, props) as Promise< ArrayBuffer | ArrayBufferView >).then((value) => { if (ArrayBuffer.isView(value)) { return value.buffer.slice( value.byteOffset, value.byteOffset + value.byteLength ); } else { return value; } }); };
The text was updated successfully, but these errors were encountered:
Make Response.arrayBuffer() always resolve with a ArrayBuffer
6f84db9
Fixes #801
21bbcbf
02a66b6
Fixes JakeChampion/fetch#801
Successfully merging a pull request may close this issue.
returns a Promise, which resolves to a
Uint8Array
.It should resolve to an
ArrayBuffer
instead.Steps to reproduce:
Load this polyfill and paste above code into the developer console.
My hacky workaround:
After loading the polyfill add the following:
The text was updated successfully, but these errors were encountered: