Bug 1233902 - Check the TP list in sendBeacon(). r=gcp
authorFrancois Marier <francois@mozilla.com>
Fri, 18 Dec 2015 17:28:00 +0100
changeset 317400 e1d9312025cc7d7e4dcbfcb070957246dc6d3448
parent 317399 25a0f896c1861a961adaf6ff70f45904e9b9ea27
child 317401 50650c9b9c482fe2b365c18fcbc42649bae1c8e9
push id8691
push userbmo:vivekb.balakrishnan@gmail.com
push dateWed, 23 Dec 2015 21:07:27 +0000
reviewersgcp
bugs1233902
milestone46.0a1
Bug 1233902 - Check the TP list in sendBeacon(). r=gcp
dom/base/Navigator.cpp
--- a/dom/base/Navigator.cpp
+++ b/dom/base/Navigator.cpp
@@ -1206,23 +1206,29 @@ Navigator::SendBeacon(const nsAString& a
   // Explicitly disallow loading data: URIs
   bool isDataScheme = false;
   rv = uri->SchemeIs("data", &isDataScheme);
   if (NS_FAILED(rv) || isDataScheme) {
     aRv.Throw(NS_ERROR_CONTENT_BLOCKED);
     return false;
   }
 
+  nsLoadFlags loadFlags = nsIRequest::LOAD_NORMAL |
+    nsIChannel::LOAD_CLASSIFY_URI;
+
   nsCOMPtr<nsIChannel> channel;
   rv = NS_NewChannel(getter_AddRefs(channel),
                      uri,
                      doc,
                      nsILoadInfo::SEC_REQUIRE_CORS_DATA_INHERITS |
                        nsILoadInfo::SEC_COOKIES_INCLUDE,
-                     nsIContentPolicy::TYPE_BEACON);
+                     nsIContentPolicy::TYPE_BEACON,
+                     nullptr, // aLoadGroup
+                     nullptr, // aCallbacks
+                     loadFlags);
 
   if (NS_FAILED(rv)) {
     aRv.Throw(rv);
     return false;
   }
 
   nsCOMPtr<nsIHttpChannel> httpChannel = do_QueryInterface(channel);
   if (!httpChannel) {