Issue #2852 - Parse full cache-control headers.

This makes sure we parse the merged/stored version of `cache-control`
instead of just the latest-received header.
`ResponseHead::ParseHeaderLine_locked` parses each header as it comes in.
It then updates its member variables based on that header.
For `cache-control`, it's important to reparse the merged (updated)
version of the header instead of the most recent one, otherwise we'll miss
directives present in previously received headers.

Resolves #2852
This commit is contained in:
Moonchild 2025-09-18 09:45:30 +02:00 committed by roytam1
commit 16164b3d38

View file

@ -633,7 +633,7 @@ nsHttpResponseHead::ParseHeaderLine_locked(const nsACString &line, bool original
mContentType, mContentCharset, &dummy);
}
else if (hdr == nsHttp::Cache_Control)
ParseCacheControl(val.get());
ParseCacheControl(mHeaders.PeekHeader(hdr));
else if (hdr == nsHttp::Pragma)
ParsePragma(val.get());
return NS_OK;