From fd528653dcc3fb3efcd0a63c8dfe7a26b923f03d Mon Sep 17 00:00:00 2001 From: "Carsten \"Tomcat\" Book" Date: Tue, 26 Jan 2016 16:11:13 +0100 Subject: [PATCH] Backed out changeset e73523d185a7 (bug 567365) for m-oth failures in test_bug112564.xul --- docshell/base/nsDocShell.cpp | 8 ++++++-- netwerk/protocol/http/nsHttpChannel.cpp | 8 +++++--- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/docshell/base/nsDocShell.cpp b/docshell/base/nsDocShell.cpp index 892b1c38624..4c66ce2b7a3 100644 --- a/docshell/base/nsDocShell.cpp +++ b/docshell/base/nsDocShell.cpp @@ -12541,9 +12541,13 @@ nsDocShell::ShouldDiscardLayoutState(nsIHttpChannel* aChannel) } // figure out if SH should be saving layout state - bool noStore = false; + nsCOMPtr securityInfo; + bool noStore = false, noCache = false; + aChannel->GetSecurityInfo(getter_AddRefs(securityInfo)); aChannel->IsNoStoreResponse(&noStore); - return noStore; + aChannel->IsNoCacheResponse(&noCache); + + return (noStore || (noCache && securityInfo)); } NS_IMETHODIMP diff --git a/netwerk/protocol/http/nsHttpChannel.cpp b/netwerk/protocol/http/nsHttpChannel.cpp index 62b0677c7ad..43222e8115c 100644 --- a/netwerk/protocol/http/nsHttpChannel.cpp +++ b/netwerk/protocol/http/nsHttpChannel.cpp @@ -3206,9 +3206,11 @@ nsHttpChannel::OnCacheEntryCheck(nsICacheEntry* entry, nsIApplicationCache* appC // which we must validate the cached response with the server. else if (mLoadFlags & nsIRequest::VALIDATE_NEVER) { LOG(("VALIDATE_NEVER set\n")); - // if no-store validate cached response (see bug 112564) - if (mCachedResponseHead->NoStore()) { - LOG(("Validating based on no-store logic\n")); + // if no-store or if no-cache and ssl, validate cached response (see + // bug 112564 for an explanation of this logic) + if (mCachedResponseHead->NoStore() || + (mCachedResponseHead->NoCache() && isHttps)) { + LOG(("Validating based on (no-store || (no-cache && ssl)) logic\n")); doValidation = true; } else {