RequestServer: Don't update Content-Length during cache revalidation

We were treating Content-Type as exempt from header updates during cache
revalidation and incorrectly allowing Content-Length to get overwritten
when handling an HTTP 304 response.

This caused cached entries to end up with a mismatched Content-Length
that described the validating response instead of the stored body.
This commit is contained in:
Andreas Kling 2025-11-15 11:40:47 +01:00 committed by Tim Flynn
parent 0311d40425
commit 880a7e6c2a
Notes: github-actions[bot] 2025-11-15 15:08:53 +00:00

View file

@ -278,7 +278,7 @@ void update_header_fields(HTTP::HeaderMap& stored_headers, HTTP::HeaderMap const
// * Header fields that are automatically processed and removed by the recipient, as described below, and
// * The Content-Length header field.
if (name.equals_ignoring_ascii_case("Content-Type"sv))
if (name.equals_ignoring_ascii_case("Content-Length"sv))
return true;
return false;