Re: [whatwg/fetch] Add HTTP fetch step on 421. (#1141)

@mnot commented on this pull request.



> +    <ol>
+     <li><p>Let <var>aborted</var> be the termination's aborted flag.
+
+     <li><p>If <var>aborted</var> is set, then return an <a>aborted network error</a>.
+
+     <li><p>Return a <a>network error</a>.
+    </ol>
+
+   <li>
+    <p>If <var>actualResponse</var>'s <a for=response>status</a> is 421,
+     <var>request</var>'s <a for=request>body</a> is non-null, and
+     <var>request</var>'s <a for=request>body</a>'s <a for=body>source</a> is
+      null, then return a <a>network error</a>.
+
+   <li><p>Set <var>response</var> to the result of performing an <a>HTTP-network-or-cache fetch</a>
+   using <var>request</var>.

The p
```suggestion
   using <var>request</var> on a new <a lt=connection>connection</a>.
```

The point of 421 is that the new request will be on a separate connection.

> @@ -4593,6 +4593,31 @@ Range Requests</cite>. [[HTTP-RANGE]] However, this is not widely supported by b
    using <var>request</var>.
   </ol>
 
+ <li>
+  <p>If <var>response</var>'s <a for=response>status</a> is 421, then:
+
+  <ol>
+   <li>
+    <p>If the ongoing fetch is <a for=fetch>terminated</a>, then:
+
+    <ol>
+     <li><p>Let <var>aborted</var> be the termination's aborted flag.
+
+     <li><p>If <var>aborted</var> is set, then return an <a>aborted network error</a>.
+
+     <li><p>Return a <a>network error</a>.

I haven't followed the whole discussion, but is there a reason that 421 isn't just forwarded through? Surfacing it as a network error is opaque, and do will be difficult to debug / handle -- is there an underlying security issue here?

-- 
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/fetch/pull/1141#pullrequestreview-579950742

Received on Sunday, 31 January 2021 23:58:24 UTC