Bug 1289564 - Don't try to modify cacheability for non-http(s) resources. r?mayhemer
MozReview-Commit-ID: 1sfBrTlzsLo
--- 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);
}
}