Re: XMLHttpRequest conformance comments

* Julian Reschke wrote:
>Bjoern Hoehrmann schrieb:
>> * Julian Reschke wrote:
>>> In particular, HTTP allows headers to be present with no value, and that 
>>> means something different than the absence of that header. Please do not 
>>> profile HTTP (where it's not needed).
>> 
>> You can tell the difference using getAllResponseHeaders(), there is no
>> "profiling" going on.
>
>Looking at the definition for all getResponseHeaders(), it seems only be 
>useful for debugging purposes. Do you seriously suggest that somebody 
>who wants to know whether an empty response header was present in the 
>response takes that concatenated string and parses it (don't forget the 
>rules about leading WS and continuation lines in 
><http://tools.ietf.org/html/rfc2616#section-4.2>).

Oh please, checking the return value of getResponseHeader() will just do
the job unless you want to tell the difference between "not present" and
"present but with a zero-length value", which is not very common; and if
you need this, you can combine that with a regex like /^name:/mi or some
custom code depending on your needs and tools. Not that I oppose the pro
posed change, you just shouldn't shout "profile!1" when there isn't one.
-- 
Björn Höhrmann · mailto:bjoern@hoehrmann.de · http://bjoern.hoehrmann.de
Weinh. Str. 22 · Telefon: +49(0)621/4309674 · http://www.bjoernsworld.de
68309 Mannheim · PGP Pub. KeyID: 0xA4357E78 · http://www.websitedev.de/ 

Received on Wednesday, 2 August 2006 07:28:18 UTC