Skip to content

Commit

Permalink
Prevent error if response is not illuminate reponse in addLinkHeader
Browse files Browse the repository at this point in the history
  • Loading branch information
indykoning committed May 29, 2024
1 parent 96b5bbd commit 1b7a08b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Middleware/AddHttp3EarlyHints.php
Original file line number Diff line number Diff line change
Expand Up @@ -221,10 +221,10 @@ private function buildLinkHeaderString(string $url, ?string $rel = 'preload'): ?
/**
* Add Link Header
*/
private function addLinkHeader(Response $response, mixed $link): Response
private function addLinkHeader(\Symfony\Component\HttpFoundation\Response $response, mixed $link): Response
{
$link = trim(collect($link)->implode(','));
if (! $link) {
if (! $link || !$response instanceof Response) {
return $response;
}
if ($response->headers->get('Link')) {
Expand Down

0 comments on commit 1b7a08b

Please sign in to comment.