@@ -4886,31 +4886,33 @@ steps:
4886
4886
<p class=note> The `<code> GET</code> ` <a for=/>method</a> restriction serves no useful purpose
4887
4887
other than being interoperable.
4888
4888
4889
+ <li><p> Let <var> blob</var> be <var> blobURLEntry</var> 's <a for="blob URL entry">object</a> .
4890
+
4889
4891
<li><p> Let <var> response</var> be a new <a for=/>response</a> .
4890
4892
4891
- <li><p> Let <var> fullLength</var> be <var> blobURLEntry</var> 's
4892
- <a for="blob URL entry">object</a> 's {{Blob/size}} ,
4893
+ <li><p> Let <var> fullLength</var> be <var> blob</var> 's {{Blob/size}} .
4894
+
4895
+ <li><p> Let <var> serializedFullLength</var> be <var> fullLength</var> ,
4893
4896
<a lt="serialize an integer">serialized</a> and <a>isomorphic encoded</a> .
4894
4897
4895
- <li><p> Let <var> type</var> be <var> blobURLEntry</var> 's
4896
- <a for="blob URL entry">object</a> 's {{Blob/type}} .
4898
+ <li><p> Let <var> type</var> be <var> blob</var> 's {{Blob/type}} .
4897
4899
4898
4900
<li>
4899
4901
<p> If <var> request</var> 's <a for=request>header list</a>
4900
4902
<a for="header list">does not contain</a> `<code> Range</code> `:
4901
4903
4902
4904
<ol>
4903
4905
<li><p> Let <var> bodyWithType</var> be the result of <a for=BodyInit>safely extracting</a>
4904
- <var> blobURLEntry </var> 's <a for=" blob URL entry">object</a > .
4906
+ <var> blob</var > .
4905
4907
4906
4908
<li><p> Set <var> response</var> 's <a for=response>status message</a> to `<code> OK</code> `.
4907
4909
4908
4910
<li><p> Set <var> response</var> 's <a for=response>body</a> to <var>bodyWithType</var>' s
4909
4911
<a for="body with type">body</a> .
4910
4912
4911
4913
<li><p> Set <var> response</var> 's <a for=response>header list</a> to «
4912
- (`<code> Content-Length</code> `, <var> fullLength </var> ), (` <code> Content-Type </code> ` ,
4913
- <var> type</var> ) ».
4914
+ (`<code> Content-Length</code> `, <var> serializedFullLength </var> ),
4915
+ (` <code> Content-Type </code> `, <var> type</var> ) ».
4914
4916
</ol>
4915
4917
4916
4918
<li>
@@ -4929,59 +4931,70 @@ steps:
4929
4931
4930
4932
<li><p> If <var> rangeValue</var> is failure, then return a <a>network error</a> .
4931
4933
4932
- <li><p> Let <var> sliceEndRange</var> be null.
4934
+ <li><p> Let (<var> rangeStart</var> , <var> rangeEnd</var> ) be <var> rangeValue</var> .
4935
+
4936
+ <li>
4937
+ <p> If <var> rangeStart</var> is null:
4938
+
4939
+ <ol>
4940
+ <li><p> Set <var> rangeStart</var> to <var> fullLength</var> − <var> rangeEnd</var> .
4941
+
4942
+ <li><p> Set <var> rangeEnd</var> to <var> rangeStart</var> + <var> rangeEnd</var> − 1.
4943
+ </ol>
4944
+
4945
+ <li>
4946
+ <p> Otherwise:
4947
+
4948
+ <ol>
4949
+ <li><p> If <var> rangeStart</var> is greater than or equal to <var> fullLength</var> , then
4950
+ return a <a>network error</a> .
4951
+
4952
+ <li><p> If <var> rangeEnd</var> is null or <var> rangeEnd</var> is greater than or equal to
4953
+ <var> fullLength</var> , then set <var> rangeEnd</var> to <var> fullLength</var> − 1.
4954
+ </ol>
4933
4955
4934
4956
<li>
4935
- <p> If <var> rangeValue </var> [1] is non-null, then set <var> sliceEndRange </var> to
4936
- <var> rangeValue </var> [1] + 1.
4957
+ <p> Let <var> slicedBlob </var> be the result of invoking <a>slice blob</a> given
4958
+ <var> blob </var> , <var> rangeStart </var> , <var> rangeEnd </var> + 1, and <var> type </var> .
4937
4959
4938
4960
<p class=note> A range header denotes an inclusive byte range, while the <a>slice blob</a>
4939
4961
algorithm input range does not. To use the <a>slice blob</a> algorithm, we have to increment
4940
- the parsed range header end value.
4941
-
4942
- <li><p> Let <var> slicedBlob</var> be the result of invoking <a>slice blob</a> given
4943
- <var> blobURLEntry</var> 's <a for="blob URL entry">object</a> , <var> rangeValue</var> [0] ,
4944
- <var> sliceEndRange</var> , and <var> type</var> .
4962
+ <var> rangeEnd</var> .
4945
4963
4946
4964
<li><p> Let <var> slicedBodyWithType</var> be the result of
4947
4965
<a for=BodyInit>safely extracting</a> <var> slicedBlob</var> .
4948
4966
4949
4967
<li><p> Set <var> response</var> 's <a for=response>body</a> to <var>slicedBodyWithType</var>' s
4950
4968
<a for="body with type">body</a> .
4951
4969
4952
- <li><p> Let <var> slicedLength </var> be <var> slicedBlob</var> 's {{Blob/size}} ,
4970
+ <li><p> Let <var> serializedSlicedLength </var> be <var> slicedBlob</var> 's {{Blob/size}} ,
4953
4971
<a lt="serialize an integer">serialized</a> and <a>isomorphic encoded</a> .
4954
4972
4955
4973
<!-- The following steps for content-range should be definined in a separate algorithm.
4956
4974
See https://github.com/whatwg/fetch/issues/1552 for future work -->
4957
4975
<li><p> Let <var> contentRange</var> be `<code> bytes </code> `.
4958
4976
4959
- <li><p> If <var> rangeValue</var> [0] is non-null, then
4960
- <a lt="serialize an integer">serialize</a> and <a>isomorphic encode</a>
4961
- <var> rangeValue</var> [0] , and append the result to <var> contentRange</var> .
4962
-
4963
- <li><p> Otherwise, append 0x30 (0) to <var> contentRange</var> .
4977
+ <li><p> Append <var> rangeStart</var> , <a lt="serialize an integer">serialized</a> and
4978
+ <a>isomorphic encoded</a> , to <var> contentRange</var> .
4964
4979
4965
4980
<li><p> Append 0x2D (-) to <var> contentRange</var> .
4966
4981
4967
- <li><p> If <var> sliceEndRange</var> is non-null, then
4968
- <a lt="serialize an integer">serialize</a> and <a>isomorphic encode</a>
4969
- <var> sliceEndRange</var> , and append the result to <var> contentRange</var> .
4970
-
4971
- <li><p> Otherwise, append <var> fullLength</var> to <var> contentRange</var> .
4982
+ <li><p> Append <var> rangeEnd</var> , <a lt="serialize an integer">serialized</a> and
4983
+ <a>isomorphic encoded</a> to <var> contentRange</var> .
4972
4984
4973
4985
<li><p> Append 0x2F (/) to <var> contentRange</var> .
4974
4986
4975
- <li><p> Append <var> fullLength </var> to <var> contentRange</var> .
4987
+ <li><p> Append <var> serializedFullLength </var> to <var> contentRange</var> .
4976
4988
4977
4989
<li><p> Set <var> response</var> 's <a for=response>status</a> to 206.
4978
4990
4979
4991
<li><p> Set <var> response</var> 's <a for=response>status message</a> to
4980
4992
`<code> Partial Content</code> `.
4981
4993
4982
4994
<li><p> Set <var> response</var> 's <a for=response>header list</a> to «
4983
- (`<code> Content-Length</code> `, <var> slicedLength</var> ), (`<code> Content-Type</code> `,
4984
- <var> type</var> ), (`<code> Content-Range</code> `, <var> contentRange</var> ) ».
4995
+ (`<code> Content-Length</code> `, <var> serializedSlicedLength</var> ),
4996
+ (`<code> Content-Type</code> `, <var> type</var> ), (`<code> Content-Range</code> `,
4997
+ <var> contentRange</var> ) ».
4985
4998
</ol>
4986
4999
4987
5000
<li><p> Return <var> response</var> .
0 commit comments