From 16164b3d38496ac585dc752b3f51ebcf1c958931 Mon Sep 17 00:00:00 2001 From: Moonchild Date: Thu, 18 Sep 2025 09:45:30 +0200 Subject: [PATCH] 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 --- netwerk/protocol/http/nsHttpResponseHead.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/netwerk/protocol/http/nsHttpResponseHead.cpp b/netwerk/protocol/http/nsHttpResponseHead.cpp index 5e119ba437..6bb328f823 100644 --- a/netwerk/protocol/http/nsHttpResponseHead.cpp +++ b/netwerk/protocol/http/nsHttpResponseHead.cpp @@ -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;