Skip to content

Commit

Permalink
Fix psalm error
Browse files Browse the repository at this point in the history
  • Loading branch information
kelunik committed Oct 4, 2022
1 parent f5123ef commit 7d5cf67
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/Interceptor/FollowRedirects.php
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,10 @@ private function getRedirectUri(Response $response): ?PsrUri
}

try {
$locationUri = Uri\Http::createFromString($response->getHeader('location'));
$header = $response->getHeader('location');
\assert($header !== null); // see check above

$locationUri = Uri\Http::createFromString($header);
} catch (\Exception $e) {
return null;
}
Expand Down

0 comments on commit 7d5cf67

Please sign in to comment.