mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-09-17 15:02:24 +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
Notes:
sideshowbarker
2024-07-16 23:49:43 +09:00
Author: https://github.com/awesomekling
Commit: 3435820e1f
Pull-request: https://github.com/SerenityOS/serenity/pull/17597
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