[dev] [commits] Horde branch master updated. 3e6d1441a7635ed9ce8078b34b356f08f22d9422

Michael Rubinsky mrubinsk at horde.org
Thu Apr 1 21:50:11 UTC 2010


Quoting Chuck Hagenbuch <chuck at horde.org>:

> Quoting Michael Rubinsky <mike at theupstairsroom.com>:
>
>>    RFC2616 (HTTP/1.1) says headers are case insensitive anyway, so  
>> we probably
>>    shouldn't be relying on case for comparisons...
>>
>> framework/Controller/lib/Horde/Controller/Request/Http.php |    4 ++--
>> 1 files changed, 2 insertions(+), 2 deletions(-)
>>
>> http://git.horde.org/diff.php/framework/Controller/lib/Horde/Controller/Request/Http.php?rt=horde-git&r1=2aa47b34d9acd2b029aa10ad96a0048b59dc06a6&r2=3e6d1441a7635ed9ce8078b34b356f08f22d9422
>
> Any idea how well browsers/servers/etc. comply with that (being  
> case-insensitive)? That'd certainly simplify things...
>
> -chuck

As far as servers go, I know that lighttd and apache handle request  
headers in a case-insensitive manner - consistent with the RFC. what  
I'm really talking about here are the response headers though. I'm not  
100% sure how each browser handles things, but the RFC definitely  
states these are to be handled in a case-insensitive manner.  A search  
on google revealed a number of bug reports from other projects related  
to case-sensitive handling of headers and in each instance that I came  
across, this was fixed by using something like strcasecmp() or similar  
when comparing the headers. For our case, I think we should use  
array_change_key_case() in the _getAllHeaders() method before  
returning the array of headers, and then in getHeader($header) we  
should strlower($header) before fetching the header from the array...

-- 
Mike

--
The Horde Project (www.horde.org)
mrubinsk at horde.org

"Reality is merely an illusion, albeit a very persistent one." - A. Einstein


More information about the dev mailing list