Package home | Report new bug | New search | Development Roadmap Status: Open | Feedback | All | Closed Since Version 1.2.1

Bug #5740 may need amendment for inappropriate header responses
Submitted: 2005-10-21 11:23 UTC
From: suteado5963 at rcdtokyo dot com Assigned:
Status: Duplicate Package: HTTP_Client
PHP Version: Irrelevant OS:
Roadmaps: (Not assigned)    
Subscription  


 [2005-10-21 11:23 UTC] suteado5963 at rcdtokyo dot com
Description: ------------ The line 290 of HTTP/Client.php of current version 1.0.0 which is written as "$request->getResponseHeader('Location')" shall be amended as "$request->getResponseHeader('location')" -- the string "location" shall be ALL LOWER-CASE, in case. As all you know, if the URI given to HTTP_Client responds the status code 301, 302, etc., HTTP_Client automatically redirects its location by default to the new URI which is normally set in "Location" field of the responded header. Today I found a server that responds the new URI in "location" field if 302, instead of the appropriate one. Now HTTP_Client is unable to find the new URI on every 302 responses of this server simply because it refers to "Location" field. Test script: --------------- // reproducible at least as of today. // would become unreproducible // if the server would change its setting. require_once 'HTTP/Client.php'; $client =& new HTTP_Client(); $client->get('http://www.simonsays.com/content/content.cfm?pid=500367'); print_r($client->currentResponse()); Expected result: ---------------- Redirected to http://www.simonsays.com/content/book.cfm?pid=500367 and the responded HTTP status code will be "200 OK". Actual result: -------------- At least as of today (unless the server changes its setting), HTTP_Client does not redirect its location with this URI as usual and the final responded HTTP status code is still "302 Found".

Comments

 [2005-11-01 12:22 UTC] User who submitted this comment has not confirmed identity
If you submitted this note, check your email.If you do not have a message, click here to re-send
MANUAL CONFIRMATION IS NOT POSSIBLE.  Write a message to pear-dev@lists.php.net
to request the confirmation link.  All bugs/comments/patches associated with this

email address will be deleted within 48 hours if the account request is not confirmed!