ZF-2229: ZCResponse::getHeader() should be case-insensitive
Description
Zend_Controller_Response_Abstract::getHeader() is case-sensitive whereas it is stated in the http rfc that header field names are case insensitive.
the two following call should return the same:
$response->getHeader('Content-Type'); $response->getHeader('content-type);
see http://w3.org/Protocols/rfc2616/… for reference
excerpt:
"Each header field consists of a name followed by a colon (":") and the field value. Field names are case-insensitive."
Comments
Posted by Michal Minicki (martel) on 2008-01-14T06:15:38.000+0000
There is now such method as Zend_Controller_Response_Abstract::getHeader() in the current code base. Shouldn't this issue be closed?
Posted by Matthew Weier O'Phinney (matthew) on 2008-01-29T12:40:51.000+0000
There isn't a getHeader() method, but there should likely be. The bigger issue is that the internal storage is case sensitive, and likely shouldn't be. As it stands currently, when calling setHeader() and asking to overwrite, if the case of the header name differs, a new header will be created and sent.
Posted by Matthew Weier O'Phinney (matthew) on 2008-02-14T11:59:39.000+0000
Scheduling for 1.0.4
Posted by Matthew Weier O'Phinney (matthew) on 2008-02-19T09:18:48.000+0000
Fixed in both trunk and release-1.0 branch.