LibWeb: Assert that we don't reuse cached resources with wrong type

This commit is contained in:
Andreas Kling 2020-06-05 23:35:08 +02:00
parent 5dc8c4a24c
commit f2aa21ebc4
Notes: sideshowbarker 2024-07-19 05:48:57 +09:00

View File

@ -79,8 +79,12 @@ RefPtr<Resource> ResourceLoader::load_resource(Resource::Type type, const LoadRe
auto it = s_resource_cache.find(request);
if (it != s_resource_cache.end()) {
dbg() << "Reusing cached resource for: " << request.url();
return it->value;
if (it->value->type() != type) {
dbg() << "FIXME: Not using cached resource for " << request.url() << " since there's a type mismatch.";
} else {
dbg() << "Reusing cached resource for: " << request.url();
return it->value;
}
}
auto resource = Resource::create({}, type, request);