From 9dd7b901ab0885778df84f9a853fccae348433de Mon Sep 17 00:00:00 2001 From: rmg-x Date: Thu, 10 Oct 2024 18:23:21 -0500 Subject: [PATCH] LibWeb/ResourceLoader: Display HTTP reason phrase in error status --- Userland/Libraries/LibWeb/Loader/ResourceLoader.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Userland/Libraries/LibWeb/Loader/ResourceLoader.cpp b/Userland/Libraries/LibWeb/Loader/ResourceLoader.cpp index 4da1882df1a..1a83e4e1f4b 100644 --- a/Userland/Libraries/LibWeb/Loader/ResourceLoader.cpp +++ b/Userland/Libraries/LibWeb/Loader/ResourceLoader.cpp @@ -10,6 +10,7 @@ #include #include #include +#include #include #include #include @@ -432,8 +433,8 @@ void ResourceLoader::load(LoadRequest& request, SuccessCallback success_callback else error_builder.append("Load failed"sv); - if (status_code.has_value()) - error_builder.appendff(" (status code: {})", *status_code); + if (status_code.has_value() && *status_code > 0) + error_builder.appendff(" (status: {} {})", *status_code, HTTP::HttpResponse::reason_phrase_for_code(*status_code)); log_failure(request, error_builder.string_view()); if (error_callback)