Consider this Headers object:
var h = new Headers()
h.append('accept', 'text/html')
h.append('accept', 'text/plain')
h.append('content-type', 'application/json')
Before:
- `h.get('accept')` returned `text/html`
- `h.getAll('accept')` returned an array of values
- `h.forEach` (and other iterables) did distinct iterations for each
value of the same header
Now:
- `h.get('accept')` returns `text/html,text/plain`
- `h.getAll()` is no more
- `h.forEach` (and other iterables) now only do one iteration for each
headers name, regardless of multiple values
This is in accordance with Section 3.1.2 of the spec, "combine" concept.
The updated tests currently break in Chrome and Firefox when exercising
the native implementation because their implementation is outdated. The
implementation in Edge is more correct, but the tests still fail there
because its implementation combines values with `, ` (notice the space)
rather than `,`.
Body of Request must be cloned using a value to avoid consumption of
it. Once a new body is initialized, re-initialize the old value.
Fixes#308, closes#335
Now splits by `\r\n` because that's the header line delimiter.
No tests because I can't figure out how to return a manually formatted
headers payload from Node.js HTTP server.
Fixes#422
Section 6.4 of the spec:
> If init’s `headers` member is present, run these substeps:
> ... Fill r’s Headers object with init’s `headers` member.
Fixes#416
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.
The Headers, Request, and Response suites should mainly be exercising
those classes and not invoking the `fetch` method. Most of those tests
that do have now been moved to the "fetch method" suite.
Section 6.3 of the spec:
> If `input` is a string, then run these substeps: ...
> Otherwise (`input` is a Request object), run these substeps: ...
It's worth noting that Chrome and Firefox don't implement this right
now, and will cast any non-Request object passed as 1st argument (even
null/undefined) to a string.
- Timeout handling for sauce_connect
- Have `saucelabs-api` show error message on HTTP errors
- Have `saucelabs-api` exit with nonzero on errors
- Exit with nonzero if Saucelabs reports that 0 tests have ran
- Abort Saucelabs API polling on "test error" (unsure what causes this)
Firefox and Chrome trigger the request's `onerror` handler when a
timeout occurs. Safari triggers the `ontimeout` handler.
This can be observed by making a request to an unroutable address:
var xhr = new XMLHttpRequest()
xhr.onload = console.log.bind(console, 'loaded')
xhr.onerror = console.log.bind(console, 'errored')
xhr.ontimeout = console.log.bind(console, 'timeout')
xhr.open('GET', 'http://10.255.255.1')
xhr.send()
Fixes#294.