ZF-11283: Zend_Http_Response extract some headers with whitespace in the end

Issue Type: Bug Created: 2011-04-13T13:33:31.000+0000 Last Updated: 2011-04-19T16:15:10.000+0000 Status: Resolved Fix version(s): - 1.11.6 (05/May/11)

Reporter: Vladimir Voronov (regtriada) Assignee: Shahar Evron (shahar) Tags: - Zend_Http_Client

  • Zend_Http_Response

Related issues: Attachments:


For the site Location header is "AxxerionFMS/fs3_site.nsf/htmlViewHomepage/website_45B33F2E8E5BAA7EC125746C005E596B " when Zend_Http_Client used, it's redirecting to new path, but can't:

<pre class="highlight">
Zend_Uri_Exception:Path "/AxxerionFMS/fs3_site.nsf/htmlViewHomepage/website_45B33F2E8E5BAA7EC125746C005E596B   " is not a valid HTTP path

I'd like to suggest to change Zend_Http_Response::extractHeaders() as follows (i.e. simply adding a trim() or rtrim() call):

<pre class="highlight">
--- a/library/Zend/Http/Response.php
+++ b/library/Zend/Http/Response.php
@@ -513,7 +513,7 @@ class Zend_Http_Response
                 $h_name = strtolower($m[1]);
-                $h_value = $m[2];
+                $h_value = trim($m[2], ' ');
                 if (isset($headers[$h_name])) {


Posted by Shahar Evron (shahar) on 2011-04-19T13:23:54.000+0000

I am unable to reproduce this with the specified URL. I will try to write a synthetic test to handle this though.

Posted by Shahar Evron (shahar) on 2011-04-19T16:15:10.000+0000

Fixed in r. 23863, merged into 1.11 release branch in 23864

Have you found an issue?

See the Overview section for more details.


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

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