Skip to content

Commit a55525c

Browse files
committed
update php samples
1 parent ec0edf4 commit a55525c

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

samples/server/petstore/php-slim4/lib/App/RegisterRoutes.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -905,25 +905,25 @@ public function __invoke(\Slim\App $app): void
905905
$authenticatorConfig = [
906906
'path' => '/',
907907
'authenticator' => new ApiKeyAuthenticator,
908-
'regex' => '/\s+(.*)$/i',
908+
'regex' => '/\s*(.*)$/i',
909909
'argument' => null,
910910
'attribute' => 'authorization_token',
911911
'error' => ['OpenAPIServer\Auth\ApiKeyAuthenticator', 'handleUnauthorized'],
912912
];
913913
if ($authMethod['isKeyInHeader']) {
914-
$authenticatorConfig = [
914+
$authenticatorConfig += [
915915
'header' => $authMethod['keyParamName'],
916916
'parameter' => null,
917917
'cookie' => null,
918918
];
919919
} else if ($authMethod['isKeyInQuery']) {
920-
$authenticatorConfig = [
920+
$authenticatorConfig += [
921921
'header' => null,
922922
'parameter' => $authMethod['keyParamName'],
923923
'cookie' => null,
924924
];
925925
} else if ($authMethod['isKeyInCookie']) {
926-
$authenticatorConfig = [
926+
$authenticatorConfig += [
927927
'header' => null,
928928
'parameter' => null,
929929
'cookie' => $authMethod['keyParamName'],

0 commit comments

Comments
 (0)