Skip to content

Commit

Permalink
Tee request body on service worker interception
Browse files Browse the repository at this point in the history
Also stop transmitting request's body in this scenario.

Service worker PR: w3c/ServiceWorker#1563.

Tests: web-platform-tests/wpt#27325.

Fixes w3c/ServiceWorker#1560 and fixes #572.
  • Loading branch information
yutakahirano authored Feb 18, 2021
1 parent 72be227 commit c64f074
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions fetch.bs
Original file line number Diff line number Diff line change
Expand Up @@ -3804,14 +3804,18 @@ these steps:
<p>If <var>request</var>'s <a>service-workers mode</a> is "<code>all</code>", then:

<ol>
<li><p>Let <var>requestForServiceWorker</var> be a <a for=request>clone</a> of
<var>request</var>.

<li><p>Set <var>response</var> to the result of invoking <a for=/>handle fetch</a> for
<var>request</var>. [[!HTML]] [[!SW]]
<var>requestForServiceWorker</var>. [[!HTML]] [[!SW]]

<li>
<p>If <var>response</var> is not null, then:

<ol>
<li><p><a>Transmit request body</a> given <var>fetchParams</var>.
<li>If <var>request</var>'s <a for=request>body</a> is non-null, then
<a for=ReadableStream>cancel</a> <var>request</var>'s <a for=request>body</a> with undefined.

<li><p>Set <var>actualResponse</var> to <var>response</var>, if <var>response</var> is not a
<a>filtered response</a>, and to <var>response</var>'s
Expand Down

0 comments on commit c64f074

Please sign in to comment.