1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 08:58:11 +00:00

LibWeb: Ignore preconnect requests for file: and data: URLs

I noticed while debugging a fully downloaded page that it was trying
to preconnect to a file:// host. That doesn't make any sense, so let's
add a tiny bit of logic to ignore preconnect requests for file: and
data: URLs.
This commit is contained in:
Andreas Kling 2023-12-28 21:33:56 +01:00
parent ac6b3c989d
commit bf5ad56085

View file

@ -77,6 +77,9 @@ void ResourceLoader::prefetch_dns(AK::URL const& url)
void ResourceLoader::preconnect(AK::URL const& url)
{
if (url.scheme().is_one_of("file"sv, "data"sv))
return;
if (ContentFilter::the().is_filtered(url)) {
dbgln("ResourceLoader: Refusing to pre-connect to '{}': \033[31;1mURL was filtered\033[0m", url);
return;