From ec0edf433af94b177767ef5ae92d8f4761fe72c0 Mon Sep 17 00:00:00 2001 From: Kevin Date: Fri, 19 Sep 2025 02:25:41 -0400 Subject: [PATCH] Issue 21958 php-slim4 throws exception (#21962) authenticatorConfig was being overwritten instead of having additional fields added. Changed the reqex from requiring leading whitespace to having it optional. --- .../resources/php-slim4-server/register_routes.mustache | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/modules/openapi-generator/src/main/resources/php-slim4-server/register_routes.mustache b/modules/openapi-generator/src/main/resources/php-slim4-server/register_routes.mustache index fcf59e8aaf3..527bdb3380f 100644 --- a/modules/openapi-generator/src/main/resources/php-slim4-server/register_routes.mustache +++ b/modules/openapi-generator/src/main/resources/php-slim4-server/register_routes.mustache @@ -197,25 +197,25 @@ class RegisterRoutes $authenticatorConfig = [ 'path' => '/', 'authenticator' => new ApiKeyAuthenticator, - 'regex' => '/\s+(.*)$/i', + 'regex' => '/\s*(.*)$/i', 'argument' => null, 'attribute' => 'authorization_token', 'error' => ['{{authPackage}}\ApiKeyAuthenticator', 'handleUnauthorized'], ]; if ($authMethod['isKeyInHeader']) { - $authenticatorConfig = [ + $authenticatorConfig += [ 'header' => $authMethod['keyParamName'], 'parameter' => null, 'cookie' => null, ]; } else if ($authMethod['isKeyInQuery']) { - $authenticatorConfig = [ + $authenticatorConfig += [ 'header' => null, 'parameter' => $authMethod['keyParamName'], 'cookie' => null, ]; } else if ($authMethod['isKeyInCookie']) { - $authenticatorConfig = [ + $authenticatorConfig += [ 'header' => null, 'parameter' => null, 'cookie' => $authMethod['keyParamName'],