Issues

ZF-97: Zend_Http_Response: to support a status line without Reason-Phrase

Issue Type: Bug Created: 2006-06-21T18:24:02.000+0000 Last Updated: 2007-07-05T14:44:28.000+0000 Status: Closed Fix version(s): - 0.1.4 (29/Jun/06)

Reporter: Naoto Ishikawa (ishinao) Assignee: Shahar Evron (shahar) Tags: - Zend_Http_Client

Related issues: Attachments:

Description

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

http://framework.zend.com/fisheye/browse/… 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://amazon.co.jp/exec/obidos/…

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);

Comments

Posted by Shahar Evron (shahar) on 2006-06-22T15:19:24.000+0000

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 :)

Posted by Naoto Ishikawa (ishinao) on 2006-06-26T03:38:59.000+0000

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.

Posted by Shahar Evron (shahar) on 2006-06-26T04:23:24.000+0000

Please check again with revision 710 - let me know if it is fixed.

Posted by Naoto Ishikawa (ishinao) on 2006-06-26T04:35:03.000+0000

I tested with revision 710, and it is fixed. Thank you.

Posted by Shahar Evron (shahar) on 2006-06-26T04:42:01.000+0000

Fixed in revision 710

Have you found an issue?

See the Overview section for more details.

Copyright

© 2006-2016 by Zend, a Rogue Wave Company. Made with by awesome contributors.

This website is built using zend-expressive and it runs on PHP 7.

Contacts