From 7400e3d8fc5ecd2be83830cab0c9bf560b7d2105 Mon Sep 17 00:00:00 2001 From: Linus Groh Date: Tue, 20 Apr 2021 19:47:23 +0200 Subject: LibWeb: Don't call ResourceLoader error callback on 4xx status code A website with a 4xx status code is still a valid website, we should not artificially hide it. In fact, many websites implement custom 404 error pages for example, often containing search functionality or links back to the homepage. This might have implications regarding the loading of stylesheets where the request 404s, but since we were not handling 5xx status codes as errors either, I think that's fine for now (but might need additional work later). Worst case, the parser rejects to load some error page HTML as CSS :^) --- Userland/Libraries/LibWeb/Loader/ResourceLoader.cpp | 5 ----- 1 file changed, 5 deletions(-) (limited to 'Userland/Libraries/LibWeb/Loader') diff --git a/Userland/Libraries/LibWeb/Loader/ResourceLoader.cpp b/Userland/Libraries/LibWeb/Loader/ResourceLoader.cpp index 7d20b25d1d..73412b137f 100644 --- a/Userland/Libraries/LibWeb/Loader/ResourceLoader.cpp +++ b/Userland/Libraries/LibWeb/Loader/ResourceLoader.cpp @@ -183,11 +183,6 @@ void ResourceLoader::load(const LoadRequest& request, Functionon_buffered_download_finish = [this, success_callback = move(success_callback), error_callback = move(error_callback), download](bool success, auto, auto& response_headers, auto status_code, ReadonlyBytes payload) { - if (status_code.has_value() && status_code.value() >= 400 && status_code.value() <= 499) { - if (error_callback) - error_callback(String::formatted("HTTP error ({})", status_code.value()), status_code); - return; - } --m_pending_loads; if (on_load_counter_change) on_load_counter_change(); -- cgit v1.2.3