W3C home > Mailing lists > Public > whatwg@whatwg.org > May 2013

Re: [whatwg] Fetch: please review!

From: Anne van Kesteren <annevk@annevk.nl>
Date: Thu, 23 May 2013 06:11:45 +0100
Message-ID: <CADnb78jRF8NJyq2wqYNMWhjVPmENnnx59c3c8vxW7D-53m+hsQ@mail.gmail.com>
To: Janusz Majnert <j.majnert@samsung.com>
Cc: WHATWG <whatwg@lists.whatwg.org>
On Wed, May 22, 2013 at 12:20 PM, Janusz Majnert <j.majnert@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!


--
http://annevankesteren.nl/
Received on Thursday, 23 May 2013 05:12:14 UTC

This archive was generated by hypermail 2.4.0 : Wednesday, 22 January 2020 16:59:59 UTC