ZF-11283: Zend_Http_Response extract some headers with whitespace in the end
Description
For the http://axxerionfs.de 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:
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):
--- a/library/Zend/Http/Response.php
+++ b/library/Zend/Http/Response.php
@@ -513,7 +513,7 @@ class Zend_Http_Response
unset($last_header);
$h_name = strtolower($m[1]);
- $h_value = $m[2];
+ $h_value = trim($m[2], ' ');
if (isset($headers[$h_name])) {
Comments
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