RE: HTTP_Request bug

From: Date: Mon, 06 Oct 2003 08:28:56 +0000
Subject: RE: HTTP_Request bug
References: 1  Groups: php.pear.dev 
Request: Send a blank email to pear-dev+get-22394@lists.php.net to get a copy of this message
> Hi sorry for writing you to this email but I forgot my pass at pear. > > The problem is that if the header is sent by the webserver with first > letter lower case e.g. header('location : > http://google.com'), you will > process this and in the headers array of the response object will appear > only location but not Location. > So the check empty($this->_response->_headers['Location']) will always > return true. What you have to do is change the above check to > empty($this->_response->_headers['location']). > Note the lowercase "L". Ah, well a better solution would be using the case insensitive header, e.g. empty($this->_response->_headers['location_i']) According to the http rfc 2616 all http headers should start with an uppercase letter. See (http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.30) But as with most programs, variations can be found, so using the case insensitive header would be the best solution which would also work with non-compliant http server. And now the 64 million euro question: Do we want to support those non-compliant http servers? With best regards, Dave Mertens

« previous php.pear.dev (#22394) next »