From 1049ac4779d37fe80adef4bbe5a01efbe03892b5 Mon Sep 17 00:00:00 2001 From: Matthew Exon Date: Mon, 1 Jul 2024 08:07:39 +0200 Subject: [PATCH] Use last URL from redirect chain --- src/Network/HTTPClient/Response/GuzzleResponse.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Network/HTTPClient/Response/GuzzleResponse.php b/src/Network/HTTPClient/Response/GuzzleResponse.php index d277f2a8df..6dbccbff9f 100644 --- a/src/Network/HTTPClient/Response/GuzzleResponse.php +++ b/src/Network/HTTPClient/Response/GuzzleResponse.php @@ -89,7 +89,7 @@ class GuzzleResponse extends Response implements ICanHandleHttpResponses, Respon $headersRedirect = $response->getHeader(RedirectMiddleware::HISTORY_HEADER) ?? []; if (count($headersRedirect) > 0) { - $this->redirectUrl = $headersRedirect[0]; + $this->redirectUrl = end($headersRedirect); $this->isRedirectUrl = true; } }