[whatwg] Fetch: please review!
j.majnert at samsung.com
Wed May 22 04:20:13 PDT 2013
On 2013-05-22 11:50, Anne van Kesteren wrote:
> I'm reaching the point where I want to start integrating
> http://fetch.spec.whatwg.org/ into http://xhr.spec.whatwg.org/ so I
> can remove a lot of the duplicate requirements with respect to
> networking and at the same time clarify a lot of the networking
> And although http://fetch.spec.whatwg.org/ is pretty dry reading it
> would be good if people could take a look at it as the idea is for it
> to define the fetching behavior across the platform. This task is
> currently divided between HTML, CORS, Web Origin Concept, and CSP
> (integration hooks not yet in Fetch) and creates a real messy
> situation for specifications building on top of them. The idea is to
> remove that complexity and have a simple hook for fetching a request
> and get a response in return.
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.
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.
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..."
* 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.
Samsung R&D Institute Poland
More information about the whatwg