Skip to content

Commit

Permalink
fix: allow empty header name (#646)
Browse files Browse the repository at this point in the history
  • Loading branch information
SMillerDev authored Nov 6, 2024
1 parent 4e2a95d commit ba8626d
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/PHPDraft/Out/OpenAPI/OpenApiRenderer.php
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,8 @@ private function toOperation(HTTPRequest $request, Transition $transition, array

foreach ($request->headers as $name => $value) {
if ($name === 'Content-Type') { continue; }
if ($name === $this->base_data['API_KEY_HEADER']) {
if (isset($this->base_data['API_KEY_HEADER'])
&& $this->base_data['API_KEY_HEADER'] === $name) {
$operation['security'] = [["api_key" => []]];
continue;
}
Expand Down Expand Up @@ -511,4 +512,4 @@ private function getTags(): array {
return $return;
}

}
}

0 comments on commit ba8626d

Please sign in to comment.