ZF-11286: Zend_Http_Client can't redirect using the Location header


For site bq. Location: Sayfas%C4%B1.aspx It throws an exception bq. Zend_Uri_Exception:Path "/ Sayfas%C4%B1.aspx" is not a valid HTTP path But browsers can redirect, using the bq.…


This happens because the Location value returned by this server is broken (invalid, has space in it which is not URL-encoded).

While this is not strictly a bug (since the server is buggy, not the client), this is definitely something we can modify to handle better, but the change has to be in Zend_Uri first. The Zend\Uri for ZF 2.0 is already designed to handle this gracefully.

If there is an elegant way to handle this without breaking BC, I will look into it. If not this will be fixed in ZF 2.0

For redirects use only, I made function with splitting url paths and url_decode/url_encode for each part and connecting again. It doesn't brake Zend_Uri logic, but works