diff --git a/netwerk/protocol/http/nsHttpResponseHead.cpp b/netwerk/protocol/http/nsHttpResponseHead.cpp index 6bb328f823..4c3c2cd639 100644 --- a/netwerk/protocol/http/nsHttpResponseHead.cpp +++ b/netwerk/protocol/http/nsHttpResponseHead.cpp @@ -620,22 +620,22 @@ nsHttpResponseHead::ParseHeaderLine_locked(const nsACString &line, bool original // permit only a single value here. if (nsHttp::ParseInt64(val.get(), &ignored, &len)) { mContentLength = len; - } - else { + } else { // If this is a negative content length then just ignore it LOG(("invalid content-length! %s\n", val.get())); } - } - else if (hdr == nsHttp::Content_Type) { + } else if (hdr == nsHttp::Content_Type) { LOG(("ParseContentType [type=%s]\n", val.get())); bool dummy; net_ParseContentType(val, mContentType, mContentCharset, &dummy); - } - else if (hdr == nsHttp::Cache_Control) + } else if (hdr == nsHttp::Cache_Control) { + // Re-parse merged header in its entirety. See Issue #2852 ParseCacheControl(mHeaders.PeekHeader(hdr)); - else if (hdr == nsHttp::Pragma) + } else if (hdr == nsHttp::Pragma) { ParsePragma(val.get()); + } + return NS_OK; }