mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-09-21 02:08:12 +03: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: https://github.com/SerenityOS/serenity/commit/3435820e1f Pull-request: https://github.com/SerenityOS/serenity/pull/17597
@ -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…
Reference in New Issue
Block a user