Bug 1297051 - CSPRO should not block mixed content. r=dveditz a=ritu
authorChristoph Kerschbaumer <ckerschb@christophkerschbaumer.com>
Wed, 24 Aug 2016 09:24:55 +0200
changeset 347894 7773a88b7025976105e73787e3f5e7541c6396df
parent 347893 c7673e35bbec1810373bf047ba9492fe17348855
child 347895 e7145d5a6c29e99bad06262ebb910f9654b97ee3
push id6389
push userraliiev@mozilla.com
push dateMon, 19 Sep 2016 13:38:22 +0000
treeherdermozilla-beta@01d67bfe6c81 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdveditz, ritu
bugs1297051
milestone50.0a2
Bug 1297051 - CSPRO should not block mixed content. r=dveditz a=ritu
dom/security/nsCSPContext.cpp
--- a/dom/security/nsCSPContext.cpp
+++ b/dom/security/nsCSPContext.cpp
@@ -318,17 +318,18 @@ nsCSPContext::GetUpgradeInsecureRequests
   return NS_OK;
 }
 
 NS_IMETHODIMP
 nsCSPContext::GetBlockAllMixedContent(bool *outBlockAllMixedContent)
 {
   *outBlockAllMixedContent = false;
   for (uint32_t i = 0; i < mPolicies.Length(); i++) {
-    if (mPolicies[i]->hasDirective(nsIContentSecurityPolicy::BLOCK_ALL_MIXED_CONTENT)) {
+     if (!mPolicies[i]->getReportOnlyFlag() &&
+        mPolicies[i]->hasDirective(nsIContentSecurityPolicy::BLOCK_ALL_MIXED_CONTENT)) {
       *outBlockAllMixedContent = true;
       return NS_OK;
     }
   }
   return NS_OK;
 }
 
 NS_IMETHODIMP