Fix: case-insensitive search of location header (#2932)

looks good!
This commit is contained in:
Florian Körner
2020-06-07 23:42:29 +02:00
committed by GitHub
parent 7faaff304a
commit ff6e5a20c3

View File

@@ -409,7 +409,7 @@ class Response
} else {
$code = (int)curl_getinfo($rch, CURLINFO_HTTP_CODE);
if ($code === 301 || $code === 302 || $code === 303) {
preg_match('/Location:(.*?)\n/', $header, $matches);
preg_match('/(?:^|\n)Location:(.*?)\n/i', $header, $matches);
$uri = trim(array_pop($matches));
} else {
$code = 0;