From 773956d90c38fd015ce021ad212e3be5e914d619 Mon Sep 17 00:00:00 2001 From: Anne van Kesteren Date: Wed, 18 Apr 2018 12:31:32 +0200 Subject: [PATCH 1/2] Handle failure while handling content codings Tests: ... Fixes #657. --- fetch.bs | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/fetch.bs b/fetch.bs index 8df4bdb9e..464521820 100644 --- a/fetch.bs +++ b/fetch.bs @@ -631,16 +631,17 @@ user-agent-defined value for the body. -

To handle content codings given codings and -bytes, run these substeps: +

To handle content codings given codings and bytes, run +these steps:

    -
  1. If codings are not supported, return bytes. +

  2. If codings are not supported, then return bytes. -

  3. Return the result of decoding bytes with the given - codings as explained in HTTP. [[!HTTP]] [[!HTTP-SEMANTICS]] [[!HTTP-COND]] [[!HTTP-CACHING]] [[!HTTP-AUTH]] +

  4. Return the result of decoding bytes with the given codings as + explained in HTTP, if codings is supported and decoding does not result in an error, and + failure otherwise. [[!HTTP]] [[!HTTP-SEMANTICS]]

- +

Requests

@@ -3973,6 +3974,8 @@ Range Requests. [[HTTP-RANGE]] However, this is not widely supported by b

This makes the `Content-Length` header unreliable to the extent that it was reliable to begin with. +

  • If bytes is failure, then terminate the ongoing fetch. +

  • Enqueue a Uint8Array object wrapping an ArrayBuffer containing bytes to stream. If that threw an exception, terminate the ongoing fetch, and @@ -6305,6 +6308,7 @@ Michael™ Smith, Mike Pennisi, Mike West, Mohamed Zergaoui, +Moritz Kneilmann, Ms2ger, Nico Schlömer, Nikhil Marathe, From 1c761187d5f8e7d80b2f5f4a39e4df8edf536a7a Mon Sep 17 00:00:00 2001 From: Anne van Kesteren Date: Mon, 23 Apr 2018 14:40:22 +0200 Subject: [PATCH 2/2] supported was already covered; also note open issue --- fetch.bs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/fetch.bs b/fetch.bs index 464521820..ff067f1cf 100644 --- a/fetch.bs +++ b/fetch.bs @@ -637,11 +637,11 @@ these steps:

    1. If codings are not supported, then return bytes. -

    2. Return the result of decoding bytes with the given codings as - explained in HTTP, if codings is supported and decoding does not result in an error, and - failure otherwise. [[!HTTP]] [[!HTTP-SEMANTICS]] +

    3. Return the result of decoding bytes with codings as explained in HTTP, + if decoding does not result in an error, and failure otherwise. [[!HTTP]] [[!HTTP-SEMANTICS]]

    - +

    Requests