Skip to content

Commit

Permalink
Simplify Response.clone()
Browse files Browse the repository at this point in the history
  • Loading branch information
mislav committed Oct 12, 2015
1 parent fd362dd commit 3f23a31
Showing 1 changed file with 1 addition and 12 deletions.
13 changes: 1 addition & 12 deletions fetch.js
Original file line number Diff line number Diff line change
Expand Up @@ -236,17 +236,6 @@
this._initBody(body)
}

function cloneBody(body) {
if (body._bodyText) {
return body._bodyText
} else if (body._bodyBlob) {
return body._bodyBlob
} else if (body._bodyFormData) {
return body._bodyFormData
}
return null
}

Request.prototype.clone = function() {
return new Request(this)
}
Expand Down Expand Up @@ -295,7 +284,7 @@
Body.call(Response.prototype)

Response.prototype.clone = function() {
return new Response(cloneBody(this), {
return new Response(this._bodyInit, {
status: this.status,
statusText: this.statusText,
headers: new Headers(this.headers),
Expand Down

0 comments on commit 3f23a31

Please sign in to comment.