Bug 908933 - CSP: Call ShouldLoad inside ShouldProcess for TYPE_OBJECT (r=sstamm)
☠☠ backed out by ab9b28208fc9 ☠ ☠
authorChristoph Kerschbaumer <mozilla@christophkerschbaumer.com>
Tue, 05 Aug 2014 11:47:08 -0700
changeset 210164 e81f1e1c9c9f8a72019bc6e807579ed8e1573724
parent 210075 9ed77991d70f4b350270edad2014cd2357527f2f
child 210165 7481265f0325ca2fce7f416bccfb62c437193181
push id1
push userroot
push dateMon, 20 Oct 2014 17:29:22 +0000
reviewerssstamm
bugs908933
milestone35.0a1
Bug 908933 - CSP: Call ShouldLoad inside ShouldProcess for TYPE_OBJECT (r=sstamm)
content/base/src/nsCSPService.cpp
--- a/content/base/src/nsCSPService.cpp
+++ b/content/base/src/nsCSPService.cpp
@@ -215,21 +215,32 @@ CSPService::ShouldProcess(uint32_t      
                           nsIURI           *aContentLocation,
                           nsIURI           *aRequestOrigin,
                           nsISupports      *aRequestContext,
                           const nsACString &aMimeTypeGuess,
                           nsISupports      *aExtra,
                           nsIPrincipal     *aRequestPrincipal,
                           int16_t          *aDecision)
 {
-  if (!aContentLocation)
+  if (!aContentLocation) {
     return NS_ERROR_FAILURE;
+  }
 
-  *aDecision = nsIContentPolicy::ACCEPT;
-  return NS_OK;
+  if (aContentType != nsIContentPolicy::TYPE_OBJECT) {
+    *aDecision = nsIContentPolicy::ACCEPT;
+    return NS_OK;
+  }
+  return ShouldLoad(aContentType,
+                    aContentLocation,
+                    aRequestOrigin,
+                    aRequestContext,
+                    aMimeTypeGuess,
+                    aExtra,
+                    aRequestPrincipal,
+                    aDecision);
 }
 
 /* nsIChannelEventSink implementation */
 NS_IMETHODIMP
 CSPService::AsyncOnChannelRedirect(nsIChannel *oldChannel,
                                    nsIChannel *newChannel,
                                    uint32_t flags,
                                    nsIAsyncVerifyRedirectCallback *callback)