From ad5e8f274219e716c2eb60d974bd835435587209 Mon Sep 17 00:00:00 2001 From: Linus Groh Date: Thu, 9 Mar 2023 14:58:04 +0000 Subject: [PATCH] WebServer+LibGUI: Use fallible version of StringBuilder::to_byte_buffer ...and simply ignore the errors for now. This allows us to remove the infallible function and avoid accumulating more callers of it. --- Userland/Libraries/LibGUI/Model.cpp | 2 +- Userland/Services/WebServer/Client.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Userland/Libraries/LibGUI/Model.cpp b/Userland/Libraries/LibGUI/Model.cpp index 8280093b92a..7689bc4413b 100644 --- a/Userland/Libraries/LibGUI/Model.cpp +++ b/Userland/Libraries/LibGUI/Model.cpp @@ -125,7 +125,7 @@ RefPtr Model::mime_data(ModelSelection const& selection) const } }); - mime_data->set_data(drag_data_type(), data_builder.to_byte_buffer()); + mime_data->set_data(drag_data_type(), data_builder.try_to_byte_buffer().release_value_but_fixme_should_propagate_errors()); mime_data->set_text(text_builder.to_deprecated_string()); if (bitmap) mime_data->set_data("image/x-raw-bitmap", bitmap->serialize_to_byte_buffer().release_value_but_fixme_should_propagate_errors()); diff --git a/Userland/Services/WebServer/Client.cpp b/Userland/Services/WebServer/Client.cpp index d2601482d19..c68dc720ea0 100644 --- a/Userland/Services/WebServer/Client.cpp +++ b/Userland/Services/WebServer/Client.cpp @@ -81,7 +81,7 @@ void Client::start() builder.append("\r\n"sv); } - auto request = builder.to_byte_buffer(); + auto request = builder.try_to_byte_buffer().release_value_but_fixme_should_propagate_errors(); dbgln_if(WEBSERVER_DEBUG, "Got raw request: '{}'", DeprecatedString::copy(request)); auto maybe_did_handle = handle_request(request);