Skip to content

Commit 9a6a87f

Browse files
github-actions[bot]Copilotsergey-tihon
authored
[repo-assist] fix: skip empty Cookie header when no cookie parameters are present (#454)
* fix: skip empty Cookie header when no cookie parameters are present When an API operation has no cookie parameters (the common case), OperationCompiler was always prepending ("Cookie", "") to the headers list. fillHeaders only filters null values — not empty strings — so the empty Cookie: header was sent with every request. Fix: only prepend the Cookie header when cookieHeader is non-empty. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * ci: trigger checks --------- Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: Sergey Tihon <sergey.tihon@gmail.com>
1 parent 8bb4b1f commit 9a6a87f

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

src/SwaggerProvider.DesignTime/OperationCompiler.fs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -365,7 +365,10 @@ type OperationCompiler(schema: OpenApiDocument, defCompiler: DefinitionCompiler,
365365
|> Seq.map(fun (name, value) -> $"{name}={value}")
366366
|> String.concat ";"
367367

368-
("Cookie", cookieHeader) :: (%headers)
368+
if String.IsNullOrEmpty cookieHeader then
369+
%headers
370+
else
371+
("Cookie", cookieHeader) :: (%headers)
369372
@>
370373

371374
(path, queryParams, headers')

0 commit comments

Comments
 (0)