From a4065431e8ddca5caa4ea0eb30b42b4f3aa14ad5 Mon Sep 17 00:00:00 2001 From: Sergey Tolkachyov Date: Mon, 20 May 2024 15:56:26 +0400 Subject: [PATCH] [5.1] Change redirect url (from headers['Location']) from array to string (#42769) --- libraries/src/Http/Transport/CurlTransport.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libraries/src/Http/Transport/CurlTransport.php b/libraries/src/Http/Transport/CurlTransport.php index 78320ae860e03..47b3485e18593 100644 --- a/libraries/src/Http/Transport/CurlTransport.php +++ b/libraries/src/Http/Transport/CurlTransport.php @@ -190,7 +190,7 @@ public function request($method, UriInterface $uri, $data = null, array $headers // Manually follow redirects if server doesn't allow to follow location using curl if ($response->code >= 301 && $response->code < 400 && isset($response->headers['Location']) && (bool) $this->getOption('follow_location', true)) { - $redirect_uri = new Uri($response->headers['Location']); + $redirect_uri = new Uri($response->headers['Location'][0]); if (\in_array($redirect_uri->getScheme(), ['file', 'scp'])) { throw new \RuntimeException('Curl redirect cannot be used in file or scp requests.');