Skip to content

Commit

Permalink
Make sure to return rejected promise if body is already consumed
Browse files Browse the repository at this point in the history
  • Loading branch information
JakeChampion committed Jul 31, 2020
1 parent 37b55c2 commit 88a5c24
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion fetch.js
Expand Up @@ -274,7 +274,10 @@ function Body() {

this.arrayBuffer = function() {
if (this._bodyArrayBuffer) {
consumed(this)
var consumed = consumed(this);
if (consumed) {
return consumed;
}
if (ArrayBuffer.isView(this._bodyArrayBuffer)) {
return Promise.resolve(
this._bodyArrayBuffer.buffer.slice(
Expand Down

0 comments on commit 88a5c24

Please sign in to comment.