Skip to content

Commit a406543

Browse files
[5.1] Change redirect url (from headers['Location']) from array to string (#42769)
1 parent 4cf154d commit a406543

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

libraries/src/Http/Transport/CurlTransport.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@ public function request($method, UriInterface $uri, $data = null, array $headers
190190

191191
// Manually follow redirects if server doesn't allow to follow location using curl
192192
if ($response->code >= 301 && $response->code < 400 && isset($response->headers['Location']) && (bool) $this->getOption('follow_location', true)) {
193-
$redirect_uri = new Uri($response->headers['Location']);
193+
$redirect_uri = new Uri($response->headers['Location'][0]);
194194

195195
if (\in_array($redirect_uri->getScheme(), ['file', 'scp'])) {
196196
throw new \RuntimeException('Curl redirect cannot be used in file or scp requests.');

0 commit comments

Comments
 (0)