@@ -777,6 +777,9 @@ production as
777
777
<ol>
778
778
<li><p> Let <var> value</var> be <var> header</var> 's <a for=header>value</a> .
779
779
780
+ <li><p> If <var> value</var> 's <a for="byte sequence">length</a> is greater than 128, then return
781
+ false.
782
+
780
783
<li>
781
784
<p> <a>Byte-lowercase</a> <var> header</var> 's <a for=header>name</a> and switch on the result:
782
785
@@ -829,13 +832,13 @@ fetch("https://victim.example/naïve-endpoint", {
829
832
</code></pre>
830
833
</div>
831
834
835
+ <dt> `<code> range</code> `
836
+ <dd><p> If <var> value</var> is not a <a>simple range header value</a> , then return false.
837
+
832
838
<dt> Otherwise
833
839
<dd><p> Return false.
834
840
</dl>
835
841
836
- <li><p> If <var> value</var> 's <a for="byte sequence">length</a> is greater than 128, then return
837
- false.
838
-
839
842
<li><p> Return true.
840
843
</ol>
841
844
@@ -1045,6 +1048,46 @@ run these steps:
1045
1048
<li><p> Return <var> values</var> .
1046
1049
</ol>
1047
1050
1051
+ <p> To determine if a <a>byte sequence</a> <var> value</var> is a
1052
+ <dfn>simple range header value</dfn> , perform the following steps. They return a <a>boolean</a> .
1053
+
1054
+ <ol>
1055
+ <li><p> Let <var> data</var> be the <a>isomorphic decoding</a> of <var> value</var> .
1056
+
1057
+ <li><p> If <var> data</var> does not <a for=string>start with</a> "<code> bytes=</code> ", then return
1058
+ false.
1059
+
1060
+ <li><p> Let <var> position</var> be a <a>position variable</a> for <var> data</var> , initially
1061
+ pointing at the 6th <a>code point</a> of <var> data</var> .
1062
+
1063
+ <li><p> Let <var> rangeStart</var> be the result of <a>collecting a sequence of code points</a> that
1064
+ are <a>ASCII digits</a> , from <var> data</var> given <var> position</var> .
1065
+
1066
+ <li><p> If the <a>code point</a> at <var> position</var> within <var> data</var> is not U+002D (-),
1067
+ then return false.
1068
+
1069
+ <li><p> Advance <var> position</var> by 1.
1070
+
1071
+ <li><p> Let <var> rangeEnd</var> be the result of <a>collecting a sequence of code points</a> that
1072
+ are <a>ASCII digits</a> , from <var> data</var> given <var> position</var> .
1073
+
1074
+ <li><p> If <var> position</var> is not past the end of <var> data</var> , then return false.
1075
+
1076
+ <li>
1077
+ <p> If <var> rangeEnd</var> 's <a for=string>length</a> is 0, then return true.
1078
+
1079
+ <p class="note"> The range end can be omitted, e.g., `<code> bytes 0-</code> ` is valid.
1080
+
1081
+ <li><p> If <var> rangeStart</var> , interpreted as decimal number, is greater than
1082
+ <var> rangeEnd</var> , interpreted as decimal number, then return false.
1083
+
1084
+ <li><p> Return true.
1085
+ </ol>
1086
+
1087
+ <p class="note"> A <a>simple range header value</a> is a subset of allowed range header values, but
1088
+ it is the most common form used by user agents when requesting media or resuming downloads. This
1089
+ format of range header value can be set using <a>add a range header</a> .
1090
+
1048
1091
<hr>
1049
1092
1050
1093
<p> A <dfn id=default-user-agent-value export>default `<code>User-Agent</code>` value</dfn> is a
@@ -1854,7 +1897,10 @@ is to return the result of <a>serializing a request origin</a> with <var>request
1854
1897
<var> last</var> , run these steps:
1855
1898
1856
1899
<ol>
1857
- <li><p> Let <var> rangeValue</var> be `<code> bytes </code> `.
1900
+ <li><p> Assert: <var> last</var> is not given, or <var> first</var> is less than or equal to
1901
+ <var> last</var> .
1902
+
1903
+ <li><p> Let <var> rangeValue</var> be `<code> bytes=</code> `.
1858
1904
1859
1905
<li><p> <a lt="serialize an integer">Serialize</a> and <a>isomorphic encode</a> <var> first</var> ,
1860
1906
and append the result to <var> rangeValue</var> .
0 commit comments