diff --git a/Client.php b/Client.php index a74d907e..a4333fb4 100644 --- a/Client.php +++ b/Client.php @@ -551,6 +551,16 @@ public function restart() */ protected function getAbsoluteUri($uri) { + if ($uri instanceof \Guzzle\Http\Message\Header){ + /** @var \Guzzle\Http\Message\Header $header */ + $header = $uri; + if ($header->getName() === 'Location') { + $headers = $header->toArray(); + $uri = $headers[0]; + } else { + return $uri; + } + } // already absolute? if (0 === strpos($uri, 'http')) { return $uri;