Fix case sensitivity for http header (#283)

This commit is contained in:
Christopher Hertel 2026-05-12 23:20:14 +02:00 • committed by GitHub
commit bfc4728792
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 3 additions and 3 deletions

View file

@ -166,7 +166,7 @@ final class AuthorizationMiddleware implements MiddlewareInterface
private function parseBearerToken(string $authorization): ?string
{
if (!preg_match('/^Bearer\\s+(.+)$/', $authorization, $matches)) {
if (!preg_match('/^Bearer\\s+(.+)$/i', $authorization, $matches)) {
return null;
}

View file

@ -70,7 +70,7 @@ final class ClientRegistrationMiddleware implements MiddlewareInterface
private function handleRegistration(ServerRequestInterface $request): ResponseInterface
{
$contentType = $request->getHeaderLine('Content-Type');
if (!str_starts_with($contentType, 'application/json')) {
if (!str_starts_with(strtolower($contentType), 'application/json')) {
return $this->jsonResponse(400, [
'error' => 'invalid_client_metadata',
'error_description' => 'Content-Type must be application/json.',