Bug 1084543 - Make shift-reload bypass the image cache for data URIs. r=seth

This commit is contained in:
Jonathan Watt 2014-10-22 10:48:36 +01:00
parent ace1b2a926
commit 1ed79a30a8

View File

@ -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;