dont add content headers if there is no contemnt

This commit is contained in:
Lillith Fox 2025-01-10 13:57:11 -05:00
parent dc9dc182c9
commit 03628aa2e5

View file

@ -218,7 +218,7 @@ app.Use(async (context, next) =>
// Add non-body headers to message.Headers for GET and other bodyless requests
foreach (var header in context.Request.Headers)
{
if (!message.Headers.Contains(header.Key) && header.Key != "Host")
if (header.Key != "Content-Length" && header.Key != "Content-Type" && header.Key != "Content-Disposition")
{
message.Headers.TryAddWithoutValidation(header.Key, header.Value.ToArray());
}