Bug 1289564 - Don't try to modify cacheability for non-http(s) resources. r=mayhemer
authorNicholas Hurley <hurley@todesschaf.org>
Tue, 26 Jul 2016 12:40:55 -0700
changeset 348848 acec32a2a1762b73b7dbce4c87fde3bd05562919
parent 348847 6bd2b7d2ebe3f81c513e4519812b2a8f3d1ca5a0
child 348849 2141360b41377772483eda4f7b360ab1a4011cbf
push id1230
push userjlund@mozilla.com
push dateMon, 31 Oct 2016 18:13:35 +0000
treeherdermozilla-release@5e06e3766db2 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmayhemer
bugs1289564
milestone50.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1289564 - Don't try to modify cacheability for non-http(s) resources. r=mayhemer MozReview-Commit-ID: 1sfBrTlzsLo
netwerk/base/Predictor.cpp
--- a/netwerk/base/Predictor.cpp
+++ b/netwerk/base/Predictor.cpp
@@ -2427,16 +2427,26 @@ Predictor::UpdateCacheability(nsIURI *so
 {
   MOZ_ASSERT(NS_IsMainThread());
 
   if (lci && lci->IsPrivate()) {
     PREDICTOR_LOG(("Predictor::UpdateCacheability in PB mode - ignoring"));
     return;
   }
 
+  if (!sourceURI || !targetURI) {
+    PREDICTOR_LOG(("Predictor::UpdateCacheability missing source or target uri"));
+    return;
+  }
+
+  if (!IsNullOrHttp(sourceURI) || !IsNullOrHttp(targetURI)) {
+    PREDICTOR_LOG(("Predictor::UpdateCacheability non-http(s) uri"));
+    return;
+  }
+
   RefPtr<Predictor> self = sSelf;
   if (self) {
     nsAutoCString method;
     requestHead.Method(method);
     self->UpdateCacheabilityInternal(sourceURI, targetURI, httpStatus,
                                      method);
   }
 }