Skip to content

Commit b453df4

Browse files
stephentoubCopilot
andcommitted
Limit bodyless header workaround to netstandard
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
1 parent b7620be commit b453df4

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

dotnet/src/CopilotRequestHandler.cs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -536,8 +536,14 @@ private static async Task<HttpRequestMessage> BuildHttpRequestAsync(LlmInference
536536
continue;
537537
}
538538

539-
if (!message.Headers.TryAddWithoutValidation(name, values) && hasBody)
539+
if (!message.Headers.TryAddWithoutValidation(name, values))
540540
{
541+
#if NETSTANDARD2_0
542+
if (!hasBody)
543+
{
544+
continue;
545+
}
546+
#endif
541547
message.Content ??= new ByteArrayContent([]);
542548
message.Content.Headers.TryAddWithoutValidation(name, values);
543549
}

0 commit comments

Comments
 (0)