There may be a little but in HTTPClient.php.
Currently, if a 301 or 302 HTTP status code is sent and if a relative url is send, the new url will be given by:
$this->resp_headers['location'] = $uri['scheme'].'://'.$uri['host'].
$this->resp_headers['location'];
but if the original url is for example
http://site.com/directory/page.php and if the relative url is "page2.php", it seems that the new url will be
http://site.com/page2.php instead of
http://site.com/directory/page2.php
Changing the previous line by the following one should fix it (even of something smarter may be found):
$this->resp_headers['location'] = $uri['scheme'].'://'.$uri['host'].
preg_replace('`[^/]*$`','',$uri['path']).'/'. //preg_replace() to get rid of "page.php" in the previous example
$this->resp_headers['location'];