Skip to content

Commit

Permalink
Remove incorrect set of bodyUsed flag when cloning a request
Browse files Browse the repository at this point in the history
  • Loading branch information
morsdyce committed Nov 19, 2016
1 parent b54dbac commit 3fc043f
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions fetch.js
Expand Up @@ -299,7 +299,7 @@
return (methods.indexOf(upcased) > -1) ? upcased : method
}

function Request(input, options) {
function Request(input, options, isCloneOperation) {
options = options || {}
var body = options.body

Expand All @@ -318,7 +318,9 @@
this.mode = input.mode
if (!body && input._bodyInit != null) {
body = input._bodyInit
input.bodyUsed = true
if (!isCloneOperation) {
input.bodyUsed = true
}
}
}

Expand All @@ -337,7 +339,7 @@
}

Request.prototype.clone = function() {
return new Request(this, { body: this._bodyInit })
return new Request(this, { body: this._bodyInit }, true)
}

function decode(body) {
Expand Down

0 comments on commit 3fc043f

Please sign in to comment.