mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-01-04 07:36:50 +00:00
LibWeb: Render HTML content if present for HTTP error pages
If an HTTP response fails with an error code (e.g 403) but still has body content, we now render the content. We only fall back to our own built-in error page if there's no body.
This commit is contained in:
committed by
Linus Groh
parent
47f5a3ea9a
commit
3435820e1f
@@ -322,7 +322,7 @@ void ResourceLoader::load(LoadRequest& request, Function<void(ReadonlyBytes, Has
|
||||
store_response_cookies(request.page().value(), request.url(), *set_cookie);
|
||||
}
|
||||
|
||||
if (!success || (status_code.has_value() && *status_code >= 400 && *status_code <= 599)) {
|
||||
if (!success || (status_code.has_value() && *status_code >= 400 && *status_code <= 599 && payload.is_empty())) {
|
||||
StringBuilder error_builder;
|
||||
if (status_code.has_value())
|
||||
error_builder.appendff("Load failed: {}", *status_code);
|
||||
|
||||
Reference in New Issue
Block a user