Bug 788365: Do not require securityInfo for AppCache entries, r=honzab
authorBrian Smith <bsmith@mozilla.com>
Wed, 26 Sep 2012 12:01:56 -0700
changeset 111770 e2da1a9124b654d16fa087e61440f5e7bb54be67
parent 111769 7b7ea868fc5d1c1f34ab55059153a7a2070ecacf
child 111771 cbfe6a468a1202143916a4805736b9b73f51b335
push idunknown
push userunknown
push dateunknown
reviewershonzab
bugs788365
milestone18.0a1
Bug 788365: Do not require securityInfo for AppCache entries, r=honzab
netwerk/protocol/http/nsHttpChannel.cpp
--- a/netwerk/protocol/http/nsHttpChannel.cpp
+++ b/netwerk/protocol/http/nsHttpChannel.cpp
@@ -3344,18 +3344,21 @@ HttpCacheQuery::OpenCacheInputStream(boo
         nsresult rv = mCacheEntry->GetSecurityInfo(
                                       getter_AddRefs(mCachedSecurityInfo));
         if (NS_FAILED(rv)) {
             LOG(("failed to parse security-info [channel=%p, entry=%p]",
                  this, mCacheEntry.get()));
             NS_WARNING("failed to parse security-info");
             return rv;
         }
-        MOZ_ASSERT(mCachedSecurityInfo);
-        if (!mCachedSecurityInfo) {
+
+        // XXX: We should not be skilling this check in the offline cache
+        // case, but we have to do so now to work around bug 794507.
+        MOZ_ASSERT(mCachedSecurityInfo || mLoadedFromApplicationCache);
+        if (!mCachedSecurityInfo && !mLoadedFromApplicationCache) {
             LOG(("mCacheEntry->GetSecurityInfo returned success but did not "
                  "return the security info [channel=%p, entry=%p]",
                  this, mCacheEntry.get()));
             return NS_ERROR_UNEXPECTED; // XXX error code
         }
     }
 
     nsresult rv = NS_OK;