[whatwg/xhr] send() flag not unset in open() - send() - open() call sequence (#94)

The xhr specification does not specify that the `send() flag` should be unset when making this sequence of calls:

1. `xhr.open()`
2. `xhr.send()` <--- sets the `send() flag`
3. `xhr.open()`

This means, based on the spec, that calls to `setRequestHeader()` (and some other methods) should fail at this stage because the `send() flag` should still be set.

The spec for the [open() method](https://xhr.spec.whatwg.org/#the-open()-method) has this:
```
10. Terminate the request. 
```

However, this does not unset the `send() flag`. Compare this to the steps of the `abort()` method:
```
1. Terminate the request. 
2. If state is either opened with the send() flag set, headers received, or loading, run the request error steps for event abort. 
```

The "request error steps" mentioned in step 2 takes care of unsetting the `send() flag`.

The test [open-send-open](https://github.com/w3c/web-platform-tests/blob/master/XMLHttpRequest/open-send-open.htm) runs this same sequence of events, so I expect that the intended behavior is to allow this usage scenario and unset the `send() flag`.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/whatwg/xhr/issues/94

Received on Friday, 14 October 2016 15:12:10 UTC