Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add chunk type checking of requestForServiceWorker's body's stream #1199

Merged
merged 7 commits into from
Apr 15, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 32 additions & 0 deletions fetch.bs
Original file line number Diff line number Diff line change
Expand Up @@ -4156,6 +4156,37 @@ these steps:
<li><p>Let <var>requestForServiceWorker</var> be a <a for=request>clone</a> of
<var>request</var>.

<li>
<p>If <var>requestForServiceWorker</var>'s <a for=/>body</a> is non-null, then:

<ol>
<li>
<p>Let <var>transformAlgorithm</var> given <var>chunk</var> be these steps:

<ol>
<li><p>If the ongoing fetch is <a for=fetch>terminated</a>, then abort these steps.

<li><p>If <var>chunk</var> is not a {{Uint8Array}} object, then
<a lt=terminated for=fetch>terminate</a> the ongoing fetch.

<li><p>Otherwise, <a for=ReadableStream>enqueue</a> <var>chunk</var>. The user agent may
split the chunk into <a>implementation-defined</a> practical sizes and
<a for=ReadableStream>enqueue</a> each of them. The user agent also may concatenate the
chunks into an <a>implementation-defined</a> practical size and
<a for=ReadableStream>enqueue</a> it.
</ol>

<li><p>Let <var>transformStream</var> be the result of <a for=TransformStream>setting up</a> a
{{TransformStream}} with <var>transformAlgorithm</var>.

<li><p>Let <var>transformedStream</var> be the result of <var>requestForServiceWorker</var>'s
<a for=/>body</a>'s <a for=body>stream</a> <a for=ReadableStream>piped through</a>
<var>transformStream</var>.

<li><p>Set <var>requestForServiceWorker</var>'s <a for=/>body</a>'s <a for=body>stream</a> to
<var>transformedStream</var>.
</ol>

<li><p>Let <var>serviceWorkerStartTime</var> be the <a for=/>coarsened shared current time</a>
given <var>fetchParams</var>'s <a for="fetch params">cross-origin isolated capability</a>.

Expand Down Expand Up @@ -7829,6 +7860,7 @@ Xabier Rodríguez,
Yehuda Katz,
Yoav Weiss,
Youenn Fablet<!-- youennf; GitHub -->,
Yoichi Osato,
平野裕 (Yutaka Hirano), and
Zhenbin Xu
for being awesome.
Expand Down