mirror of
https://github.com/fergalmoran/ladybird.git
synced 2025-12-28 12:18:25 +00:00
LibWeb: Treat all HTTP 4xx codes as errors
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user