New issue
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
Make Response.arrayBuffer() always resolve with a ArrayBuffer
#816
Conversation
I'm not familiar with the code base, but maybe it is a better idea to convert the view to a buffer, where it is set instead of where it is used.
Because there might be other places where code is expecting an ArrayBuffer instead of a view.
@@ -274,7 +274,17 @@ function Body() { | |||
|
|||
this.arrayBuffer = function() { | |||
if (this._bodyArrayBuffer) { | |||
return consumed(this) || Promise.resolve(this._bodyArrayBuffer) | |||
consumed(this) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Consumed returns either undefined
or a rejected Promise.
The previous code returned the rejected Promise.
This changes the original behaviour.
Was that intended?
Fixes #801