Re: [whatwg/fetch] Deferred fetching (PR #1647)

@mingyc commented on this pull request.



> +   <a for=request>body</a>'s <a for=body>length</a> is null, then throw a {{TypeError}}.
+
+   <li><p>Set <var>totalScheduledDeferredBytesForOrigin</var> to <var>request</var>'s
+   <a for=request>body</a>'s <a for=body>length</a>.
+  </ol>
+ </li>
+
+ <li><p><a for=list>For each</a> <a>deferred fetch record</a> <var>deferredRecord</var> in
+ <var>request</var>'s <a for=request>client</a>'s <a for=fetch>fetch group</a>'s
+ <a for="fetch group">deferred fetch records</a>: if <var>deferredRecord</var>'s
+ <a for="deferred fetch record">request</a>'s <a for=request>body</a> is not null and
+ <var>deferredRecord</var>'s <a for="deferred fetch record">request</a>'s <a for=request>URL</a>'s
+ <a for=url>origin</a> is <a>same origin</a> with <var>request</var>'s <a for=request>URL</a>'s
+ <a for=url>origin</a>, then increment <var>totalScheduledDeferredBytesForOrigin</var> by
+ <var>deferredRecord</var>'s <a for="deferred fetch record">request</a>'s <a for=request>body</a>'s
+ <a for=body>length</a>.

```
I think we should throw a network error when calling fetchLater with a non http(s) URL.
```

Isn't it already specified to throw `TypeError`?

```
5. If request’s  URL’s  scheme is not an HTTP(S) scheme then throw a TypeError.
```
https://whatpr.org/fetch/1647/53e4c3d...71fd383.html#fetch-later-method


--

My comment [above](https://github.com/whatwg/fetch/pull/1647#discussion_r1311095896) is about the type of the request body of a `Post` fetchLater request being something that its length cannot be decided before sending. But I read somewhere that fetchLater request like `ReadableStream` should just be rejected. Could it be explicitly specifing here?

-- 
Reply to this email directly or view it on GitHub:
https://github.com/whatwg/fetch/pull/1647#discussion_r1314458643
You are receiving this because you are subscribed to this thread.

Message ID: <whatwg/fetch/pull/1647/review/1608793521@github.com>

Received on Monday, 4 September 2023 05:44:30 UTC