diff --git a/image/src/imgLoader.cpp b/image/src/imgLoader.cpp index a96e00796d4..063cf53cfb5 100644 --- a/image/src/imgLoader.cpp +++ b/image/src/imgLoader.cpp @@ -1611,11 +1611,16 @@ bool imgLoader::ValidateEntry(imgCacheEntry *aEntry, aCORSMode, aLoadingPrincipal)) return false; - // Never validate data URIs. + // data URIs are immutable and by their nature can't leak data, so we can + // just return true in that case. Doing so would mean that shift-reload + // doesn't reload data URI documents/images though (which is handy for + // debugging during gecko development) so we make an exception in that case. nsAutoCString scheme; aURI->GetScheme(scheme); - if (scheme.EqualsLiteral("data")) + if (scheme.EqualsLiteral("data") && + !(aLoadFlags & nsIRequest::LOAD_BYPASS_CACHE)) { return true; + } bool validateRequest = false;