History | Log In     View a printable version of the current page.  
Issue Details (XML | Word | Printable)

Key: ZF-97
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Major Major
Assignee: Shahar Evron
Reporter: Naoto Ishikawa
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
Google issue summary
Zend Framework

Zend_Http_Response: to support a status line without Reason-Phrase

Created: 21/Jun/06 06:24 PM   Updated: 05/Jul/07 02:44 PM
Component/s: Zend_Http_Client
Affects Version/s: None
Fix Version/s: 0.1.4

Time Tracking:
Not Specified

Resolution Date: 26/Jun/06 04:42 AM


 Description  « Hide
At the incubator version of Zend_Http_Client,
Zend_Http_Response::extractCode method uses following regular expression code.

http://framework.zend.com/fisheye/browse/Zend_Framework/trunk/incubator/library/Zend/Http/Response.php?r=trunk#l360
preg_match("|^HTTP/[\d\.x]+ (\d+) |", $response_str, $m);

But some web servers return a status line without Reason-Phrase field.
ex) HTTP/1.1 301
see: wget -S http://www.amazon.co.jp/exec/obidos/ASIN/4334033547/ref=nosim/

To support these servers, it will be changed like this.
Zend_Http_Response::extractCode

  • preg_match("|^HTTP/[\d\.x]+ (\d+) |", $response_str, $m);
    + preg_match("|^HTTP/[\d\.x]+ (\d+)|", $response_str, $m);

Zend_Http_Response::extractVersion

  • preg_match("|^HTTP/([\d\.x]+) \d+ |", $response_str, $m);
    + preg_match("|^HTTP/([\d\.x]+) \d+|", $response_str, $m);


 All   Comments   Work Log   Change History   FishEye   Crucible      Sort Order: Ascending order - Click to sort in descending order
Shahar Evron - 22/Jun/06 03:19 PM
I was not able to get a code-only response from the server you sent - but I followed your suggestion and fixed it.

Please test again with revision 694

Thank you


Naoto Ishikawa - 26/Jun/06 03:38 AM
I tested with revision 707(sorry, I'm late),
and the problem with the response without Reason-Pharse is fixed.

But I found another bug in Zend_Http_Client revision 707 at line 327.

  • ((! $this->doStrictRedirects) && ($response->getStatus() == 302 || $response->getStatus == 301))) {
    + ((! $this->doStrictRedirects) && ($response->getStatus() == 302 || $response->getStatus() == 301))) {

Please check it.


Shahar Evron - 26/Jun/06 04:23 AM
Please check again with revision 710 - let me know if it is fixed.

Naoto Ishikawa - 26/Jun/06 04:35 AM
I tested with revision 710, and it is fixed.
Thank you.

Shahar Evron - 26/Jun/06 04:42 AM
Fixed in revision 710