Home » HTTP » HTTP_Header » Bug #5409
Headers are sent in lower-case
Details
| Submitted | 2005-09-15 07:33 UTC |
|---|---|
| From | gugglegum at gmail dot com |
| Status | Bogus |
| Package | HTTP_Header |
| PHP Version | Irrelevant |
| OS | Irrelevant |
| Roadmaps | (Not assigned) |
Comments
[2005-09-15 07:33 UTC] gugglegum at gmail dot com
Description:
------------
Headers sent in lower-case:
HTTP/1.1 200 OK
Date: Thu, 15 Sep 2005 07:06:26 GMT
Server: Apache/1.3.33 (Win32) PHP/5.0.5
X-Powered-By: PHP/5.0.5
last-modified: Wed, 14 Sep 2005 21:17:48 GMT
Content-Encoding: gzip
Vary: Accept-Encoding
Connection: close
Content-Type: text/html; charset=windows-1251
Look at "last-modified". I have checked the source, you do lowercase for all setting headers, but you do not make reverse transformation when sending. I offer following code to restore header's name before send:
str_replace(' ', '-', ucwords(str_replace('-', ' ', $header)))
[2005-09-15 10:44 UTC] gugglegum at gmail dot com
Well, formally it is not a bug. Standard says that HTTP header name is case-insensitive. But "good practice" is to use something like "camel-syntax", when first letter of each word in uppercase and all other letters in lowercase.