Re: [whatwg/fetch] Fail request when its streaming body is used in ServiceWorker (#1144)

@yutakahirano commented on this pull request.



> @@ -3834,9 +3834,32 @@ optional <i>CORS-preflight flag</i>, run these steps:
   <p>If <var>request</var>'s <a>service-workers mode</a> is "<code>all</code>", then:
 
   <ol>
+   <li><p>Assert: <var>request</var> 's <a for=request>body</a> is either null or a
+   <a for=/>body</a>.
+
+   <li>
+    <p>Let <var>savedBody</var> be a copy of <var>request</var>'s <a for=request>body</a>.

If we tee the request body before passing it to the service worker (it is hard to implement TBH - I think we will not be able to implement it in the first release), I would like to allow reading the body in the network fallback case. I'm uncomfortable with having magic in the clone operation, and that is more important to me than enforcing the "read once" rule. @annevk, what do you think?

-- 
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/1144#discussion_r575211255

Received on Friday, 12 February 2021 13:10:11 UTC