Re: [whatwg/fetch] blob: URLs and range requests (#1070)

Both Safari and Chromium pass `A simple blob range request with whitespace.` in https://github.com/web-platform-tests/wpt/pull/34384. This seems to indicate that they both handle whitespace as described in [HTTP-RANGE](https://www.rfc-editor.org/rfc/rfc7233#section-2.1).

> The discrepancy is that the HTTP specification does allow whitespace in a number of places (although this is not obvious). But it seems okayish if we don't as we already subset the value space.

Yeah, as a start I think it is reasonable to not handle whitespace.

In the long run I'd guess we'll need a "single range header" and "http-range header" parser. Since both implementations of blob range requests do currently handle whitespace (and it is reasonable to do so for a blob range request). Would it be a significant effort to add support for whitespace in the blob range request case but not in the  CORS-safelisted request-header check? Could we add a "no whitespace for me please!" input value to the singe range parser? Alternatively are we able to split up the parser a bit? e.g.

Parse single range header:
 - parse `bytes=`
 - parse a range

Parse HTTP range header:
 - parse `bytes=`
 - consume whitespace
 - parse a range

This is where my lack of experience in working on these specs becomes very evident 😄 Feedback on what sorts of things are encouraged and improve readability in cases like this are very much welcomed!

-- 
Reply to this email directly or view it on GitHub:
https://github.com/whatwg/fetch/issues/1070#issuecomment-1279076672

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

Message ID: <whatwg/fetch/issues/1070/1279076672@github.com>

Received on Friday, 14 October 2022 14:20:29 UTC