Skip to content

Commit 4a7bf35

Browse files
authored
Editorial: introduce "as a body" operation for byte sequences
Exported for usage in HTML's navigate algorithm.
1 parent 4cd70cf commit 4a7bf35

File tree

1 file changed

+11
-10
lines changed

1 file changed

+11
-10
lines changed

fetch.bs

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1263,6 +1263,10 @@ worked on in <a href=https://github.com/whatwg/fetch/issues/1156>issue #1156</a>
12631263
<var>body</var>.
12641264
</ol>
12651265

1266+
<p>To get a <a for=/>byte sequence</a> <var>bytes</var>
1267+
<dfn export for="byte sequence">as a body</dfn>, return the <a for="body with type">body</a> of the
1268+
result of <a for=BodyInit>safely extracting</a> <var>bytes</var>.
1269+
12661270
<hr>
12671271

12681272
<p>To <dfn export for=body>incrementally read</dfn> a <a for=/>body</a> <var>body</var>, given an
@@ -3986,8 +3990,8 @@ the request.
39863990
<var>crossOriginIsolatedCapability</var>.
39873991

39883992
<li><p>If <var>request</var>'s <a for=request>body</a> is a <a for=/>byte sequence</a>, then set
3989-
<var>request</var>'s <a for=request>body</a> to the <a for="body with type">body</a> of the result
3990-
of <a for=BodyInit>safely extracting</a> <var>request</var>'s <a for=request>body</a>.
3993+
<var>request</var>'s <a for=request>body</a> to <var>request</var>'s <a for=request>body</a>
3994+
<a for="byte sequence">as a body</a>.
39913995

39923996
<li><p>If <var>request</var>'s <a for=request>window</a> is "<code>client</code>", then set
39933997
<var>request</var>'s <a for=request>window</a> to <var>request</var>'s <a for=request>client</a>,
@@ -4398,9 +4402,8 @@ steps:
43984402
<var>request</var>'s <a for=request>integrity metadata</a>, then run
43994403
<var>processBodyError</var> and abort these steps. [[!SRI]]
44004404

4401-
<li><p>Set <var>response</var>'s <a for=response>body</a> to the
4402-
<a for="body with type">body</a> of the result of <a for=BodyInit>safely extracting</a>
4403-
<var>bytes</var>.
4405+
<li><p>Set <var>response</var>'s <a for=response>body</a> to <var>bytes</var>
4406+
<a for="byte sequence">as a body</a>.
44044407

44054408
<li><p>Run <a>fetch response handover</a> given <var>fetchParams</var> and <var>response</var>.
44064409
</ol>
@@ -4569,8 +4572,7 @@ steps:
45694572
"<code>blank</code>", then return a new <a for=/>response</a> whose
45704573
<a for=response>status message</a> is `<code>OK</code>`, <a for=response>header list</a> is «
45714574
(`<code>Content-Type</code>`, `<code>text/html;charset=utf-8</code>`) », and
4572-
<a for=response>body</a> is the <a for="body with type">body</a> of the result of
4573-
<a for=BodyInit>safely extracting</a> the empty byte sequence.
4575+
<a for=response>body</a> is the empty byte sequence <a for="byte sequence">as a body</a>.
45744576

45754577
<p>Otherwise, return a <a>network error</a>.
45764578

@@ -4632,9 +4634,8 @@ steps:
46324634

46334635
<li><p>Return a new <a for=/>response</a> whose <a for=response>status message</a> is
46344636
`<code>OK</code>`, <a for=response>header list</a> is « (`<code>Content-Type</code>`,
4635-
<var>mimeType</var>) », and <a for=response>body</a> is the <a for="body with type">body</a> of
4636-
the result of <a for=BodyInit>safely extracting</a> <var>dataURLStruct</var>'s
4637-
<a for="data: URL struct">body</a>.
4637+
<var>mimeType</var>) », and <a for=response>body</a> is <var>dataURLStruct</var>'s
4638+
<a for="data: URL struct">body</a> <a for="byte sequence">as a body</a>.
46384639
</ol>
46394640

46404641
<dt>"<code>file</code>"

0 commit comments

Comments
 (0)