Skip to content

Commit 880a7e6

Browse files
awesomeklingtrflynn89
authored andcommitted
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.
1 parent 0311d40 commit 880a7e6

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Services/RequestServer/Cache/Utilities.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -278,7 +278,7 @@ void update_header_fields(HTTP::HeaderMap& stored_headers, HTTP::HeaderMap const
278278
// * Header fields that are automatically processed and removed by the recipient, as described below, and
279279

280280
// * The Content-Length header field.
281-
if (name.equals_ignoring_ascii_case("Content-Type"sv))
281+
if (name.equals_ignoring_ascii_case("Content-Length"sv))
282282
return true;
283283

284284
return false;

0 commit comments

Comments
 (0)