[whatwg] Fetch: please review!

Anne van Kesteren annevk at annevk.nl
Wed May 22 22:11:45 PDT 2013

On Wed, May 22, 2013 at 12:20 PM, Janusz Majnert <j.majnert at samsung.com> wrote:
> I have a few notes to make on the use of "byte string" notion.
> First of all, let's look at the definition of "byte string":
> "A byte string is a byte sequence written down as a string."
> Where "byte" and "string" are:
> "A byte is a sequence of eight bits, represented as a double-digit
> hexadecimal number in the range 0x00 to 0xFF."
> "A string is a sequence of code points." and later "A code point is a
> Unicode code point and is represented as a four-to-six digit hexadecimal
> number, typically prefixed with "U+"."
> So, just by looking at the definition, I would expect a byte string to be a
> sequence of hex numbers. That is of course not what is put in the examples
> and not what this definition aimed for.

If you have a better way to do this, please do suggest. This problem
has been introduced by HTTP and I think it's important to make sure we
carefully distinguish between what are actually bytes and what are
strings, while still maintaining the readability of Content-Type over
expressing that as a sequence of hex numbers.

> The second note is more of a question: why is the "byte string" even used?
> Why not use just string? The document contains just one occurrence of plain
> "string" and could very well be replaced with a byte string.

Well, e.g. XMLHttpRequest has both and code points are quite distinct
from bytes so it seemed useful to have them as distinct concepts.

> And now for some things I think are errors:
> * in section "4.5 CORS check", point 4 reads "If request's origin serialized
> to bytes is not result, return failure." I think it should be "...serialized
> to byte string..."

Good call.

> * in section "4.1 Basic fetch", "about" bullet reads: "... header whose name
> is Content-Type and value is "text/html;charset=utf-8", and...". I think, as
> the value of a header is defined to be a byte string, that there should be
> no quotation marks around text/html;charset=utf-8.

Fixed both. Thanks!


More information about the whatwg mailing list