Skip to content

Commit

Permalink
Always construct a new Request instance in fetch()
Browse files Browse the repository at this point in the history
Section 6.5 of the spec:

> Let `request` be the associated request of the result of invoking
> the initial value of Request as constructor with `input` and `init`
> as arguments.
  • Loading branch information
mislav committed Nov 10, 2016
1 parent ba7ffda commit 43c638a
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions fetch.js
Original file line number Diff line number Diff line change
Expand Up @@ -372,13 +372,7 @@

self.fetch = function(input, init) {
return new Promise(function(resolve, reject) {
var request
if (Request.prototype.isPrototypeOf(input) && !init) {
request = input
} else {
request = new Request(input, init)
}

var request = new Request(input, init)
var xhr = new XMLHttpRequest()

function responseURL() {
Expand Down

0 comments on commit 43c638a

Please sign in to comment.