Skip to content

Commit

Permalink
[5.1] Change redirect url (from headers['Location']) from array to st…
Browse files Browse the repository at this point in the history
…ring (#42769)
  • Loading branch information
sergeytolkachyov authored May 20, 2024
1 parent 4cf154d commit a406543
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion libraries/src/Http/Transport/CurlTransport.php
Original file line number Diff line number Diff line change
Expand Up @@ -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.');
Expand Down

0 comments on commit a406543

Please sign in to comment.