mirror of
https://github.com/RGBCube/serenity
synced 2025-07-08 14:57:35 +00:00
LibWeb: Treat all HTTP 4xx codes as errors
This commit is contained in:
parent
505b133fda
commit
4f7c7bbb09
1 changed files with 2 additions and 2 deletions
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue