diff options
author | Andreas Kling <kling@serenityos.org> | 2020-06-25 17:18:49 +0200 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2020-06-25 17:19:29 +0200 |
commit | 4f7c7bbb09814ebfc845fd5094096b2108187a4a (patch) | |
tree | f0c3bb7ea6d520a471a2726197c8617536ec3923 /Libraries | |
parent | 505b133fda52a97c58030a8b65345dd66a30c247 (diff) | |
download | serenity-4f7c7bbb09814ebfc845fd5094096b2108187a4a.zip |
LibWeb: Treat all HTTP 4xx codes as errors
Diffstat (limited to 'Libraries')
-rw-r--r-- | Libraries/LibWeb/Loader/ResourceLoader.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Libraries/LibWeb/Loader/ResourceLoader.cpp b/Libraries/LibWeb/Loader/ResourceLoader.cpp index 20c12e452b..d359ad0b4c 100644 --- a/Libraries/LibWeb/Loader/ResourceLoader.cpp +++ b/Libraries/LibWeb/Loader/ResourceLoader.cpp @@ -172,9 +172,9 @@ void ResourceLoader::load(const URL& url, Function<void(const ByteBuffer&, const error_callback("HTTP load failed"); return; } - if (status_code.has_value() && status_code.value() == 404) { + if (status_code.has_value() && status_code.value() >= 400 && status_code.value() <= 499) { if (error_callback) - error_callback("HTTP not found (four-oh-four!)"); + error_callback(String("HTTP error (%u)", status_code.value())); return; } success_callback(ByteBuffer::copy(payload.data(), payload.size()), response_headers); |