Re: [whatwg/fetch] Add support for parsing a suffix byte range spec (PR #1454)

@annevk commented on this pull request.

This looks good, modulo a couple of small nits. Note that I'll be out for at least another two weeks. Hope that's not too discouraging as I really like your contributions!

> @@ -867,7 +867,11 @@ fetch("https://victim.example/naïve-endpoint", {
     </div>
 
    <dt>`<code>range</code>`
-   <dd><p>If <var>value</var> is not a <a>simple range header value</a>, then return false.
+   <dd>
+    <ol>
+     <li><p>Let <var>rangeResult</var> be the result of <a>parse a single range header value</a>.

We need to pass the parser something to operate on and we usually separate the list items by a newline.
```suggestion
     <li><p>Let <var>rangeResult</var> be the result of <a>parse a single range header value</a>
     given <var>value</var>.

```

> @@ -1077,14 +1081,14 @@ run these steps:
  <li><p>Return <var>values</var>.
 </ol>
 
-<p>To determine if a <a>byte sequence</a> <var>value</var> is a
-<dfn>simple range header value</dfn>, perform the following steps. They return a <a>boolean</a>.
+<p>To <dfn lt="parse a single range header value|single range header value">parse a single range header value</dfn>

I don't think we need to make "single range header value" able to reference this? We should also keep the ID `simple-range-header-value` working I think.

>  
  <li><p>Advance <var>position</var> by 1.
 
  <li><p>Let <var>rangeEnd</var> be the result of <a>collecting a sequence of code points</a> that
  are <a>ASCII digits</a>, from <var>data</var> given <var>position</var>.
 
- <li><p>If <var>position</var> is not past the end of <var>data</var>, then return false.
+ <li><p>If <var>position</var> is not past the end of <var>data</var>, then return failure.
 
  <li>

If an `<li>` contains a single `<p>` there should not be a newline as is done above.

> @@ -1077,14 +1081,14 @@ run these steps:
  <li><p>Return <var>values</var>.
 </ol>
 
-<p>To determine if a <a>byte sequence</a> <var>value</var> is a
-<dfn>simple range header value</dfn>, perform the following steps. They return a <a>boolean</a>.
+<p>To <dfn lt="parse a single range header value|single range header value">parse a single range header value</dfn>
+from a <a>byte sequence</a> <var>value</var>, run these steps:

It returns failure or a https://infra.spec.whatwg.org/#tuples of two items each of which is null or a number. I'm not sure it's worth writing that out however.

-- 
Reply to this email directly or view it on GitHub:
https://github.com/whatwg/fetch/pull/1454#pullrequestreview-1054337398

You are receiving this because you are subscribed to this thread.

Message ID: <whatwg/fetch/pull/1454/review/1054337398@github.com>

Received on Thursday, 28 July 2022 15:37:53 UTC