diff --git a/src/Security/AuthenticationEntryPoint.php b/src/Security/AuthenticationEntryPoint.php index f99d2118..882bef00 100644 --- a/src/Security/AuthenticationEntryPoint.php +++ b/src/Security/AuthenticationEntryPoint.php @@ -74,6 +74,16 @@ class AuthenticationEntryPoint implements AuthenticationEntryPointInterface $contentType = $request->headers->get('Content-Type'); $accept = $request->headers->get('Accept'); - return str_contains($contentType, 'json') || str_contains($accept, 'json'); + $tmp = false; + + if ($contentType !== null) { + $tmp = str_contains($contentType, 'json'); + } + + if ($accept !== null) { + $tmp = $tmp || str_contains($accept, 'json'); + } + + return $tmp; } } \ No newline at end of file