@@ -887,7 +887,8 @@ fetch("https://victim.example/naïve-endpoint", {
887
887
</div>
888
888
889
889
<dt> `<code> range</code> `
890
- <dd><p> If <var> value</var> is not a <a>simple range header value</a> , then return false.
890
+ <dd><p> If the result of <a>parse a single range header value</a> given <var> value</var> is
891
+ failure, then return false.
891
892
892
893
<dt> Otherwise
893
894
<dd><p> Return false.
@@ -1106,45 +1107,52 @@ run these steps:
1106
1107
<li><p> Return <var> values</var> .
1107
1108
</ol>
1108
1109
1109
- <p> To determine if a <a>byte sequence</a> <var> value</var> is a
1110
- <dfn>simple range header value</dfn > , perform the following steps. They return a <a>boolean</a> .
1110
+ <p> To <dfn id=simple-range-header-value>parse a single range header value</dfn> from a
1111
+ <a>byte sequence</a> <var> value</var > , run these steps:
1111
1112
1112
1113
<ol>
1113
1114
<li><p> Let <var> data</var> be the <a>isomorphic decoding</a> of <var> value</var> .
1114
1115
1115
1116
<li><p> If <var> data</var> does not <a for=string>start with</a> "<code> bytes=</code> ", then return
1116
- false .
1117
+ failure .
1117
1118
1118
1119
<li><p> Let <var> position</var> be a <a>position variable</a> for <var> data</var> , initially
1119
1120
pointing at the 6th <a>code point</a> of <var> data</var> .
1120
1121
1121
1122
<li><p> Let <var> rangeStart</var> be the result of <a>collecting a sequence of code points</a> that
1122
1123
are <a>ASCII digits</a> , from <var> data</var> given <var> position</var> .
1123
1124
1125
+ <li><p> Let <var> rangeStartValue</var> be <var> rangeStart</var> , interpreted as decimal number, if
1126
+ <var> rangeStart</var> is not the empty string; otherwise null.
1127
+
1124
1128
<li><p> If the <a>code point</a> at <var> position</var> within <var> data</var> is not U+002D (-),
1125
- then return false .
1129
+ then return failure .
1126
1130
1127
1131
<li><p> Advance <var> position</var> by 1.
1128
1132
1129
1133
<li><p> Let <var> rangeEnd</var> be the result of <a>collecting a sequence of code points</a> that
1130
1134
are <a>ASCII digits</a> , from <var> data</var> given <var> position</var> .
1131
1135
1132
- <li><p> If <var> position</var> is not past the end of <var> data</var> , then return false.
1136
+ <li><p> Let <var> rangeEndValue</var> be <var> rangeEnd</var> , interpreted as decimal number, if
1137
+ <var> rangeEnd</var> is not the empty string; otherwise null.
1133
1138
1134
- <li>
1135
- <p> If <var> rangeEnd</var> 's <a for=string>length</a> is 0, then return true.
1139
+ <li><p> If <var> position</var> is not past the end of <var> data</var> , then return failure.
1136
1140
1137
- <p class="note"> The range end can be omitted, e.g., ` <code> bytes=0- </code> ` is valid .
1141
+ <li><p> If <var> rangeEndValue </var> and <var> rangeStartValue </var> are null, then return failure .
1138
1142
1139
- <li><p> If <var> rangeStart </var> , interpreted as decimal number, is greater than
1140
- <var> rangeEnd </var> , interpreted as decimal number , then return false .
1143
+ <li><p> If <var> rangeStartValue </var> and <var> rangeEndValue </var> are numbers, and
1144
+ <var> rangeStartValue </var> is greater than <var> rangeEndValue </var> , then return failure .
1141
1145
1142
- <li><p> Return true.
1146
+ <li>
1147
+ <p> Return (<var> rangeStartValue</var> , <var> rangeEndValue</var> ).
1148
+
1149
+ <p class="note"> The range end or start can be omitted, e.g., `<code> bytes=0-</code> ` or
1150
+ `<code> bytes=-500</code> ` are valid ranges.
1143
1151
</ol>
1144
1152
1145
- <p class=" note"> A <a>simple range header value</a> is a subset of allowed range header values, but
1146
- it is the most common form used by user agents when requesting media or resuming downloads. This
1147
- format of range header value can be set using <a>add a range header</a> .
1153
+ <p class=note> <a>Parse a single range header value</a> succeeds for a subset of allowed range header
1154
+ values, but it is the most common form used by user agents when requesting media or resuming
1155
+ downloads. This format of range header value can be set using <a>add a range header</a> .
1148
1156
1149
1157
<hr>
1150
1158
0 commit comments