mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 14:28:12 +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:
parent
47f5a3ea9a
commit
3435820e1f
1 changed files with 1 additions and 1 deletions
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue