From cd4804ed1caccbc097595ded31a4e2a7740d38fe Mon Sep 17 00:00:00 2001 From: Karol Baraniecki Date: Tue, 7 Mar 2023 14:36:40 +0100 Subject: LibWeb: Use fallible version of StringBuilder::to_byte_buffer --- Userland/Libraries/LibWeb/WebDriver/Client.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'Userland/Libraries/LibWeb') diff --git a/Userland/Libraries/LibWeb/WebDriver/Client.cpp b/Userland/Libraries/LibWeb/WebDriver/Client.cpp index 135523651e..70c3bdd3d3 100644 --- a/Userland/Libraries/LibWeb/WebDriver/Client.cpp +++ b/Userland/Libraries/LibWeb/WebDriver/Client.cpp @@ -220,7 +220,7 @@ ErrorOr Client::on_ready_to_read() break; } - m_request = HTTP::HttpRequest::from_raw_request(builder.to_byte_buffer()); + m_request = HTTP::HttpRequest::from_raw_request(TRY(builder.try_to_byte_buffer())); if (!m_request.has_value()) return {}; @@ -278,7 +278,7 @@ ErrorOr Client::send_success_response(JsonValue resu builder.appendff("Content-Length: {}\r\n", content.length()); builder.append("\r\n"sv); - auto builder_contents = builder.to_byte_buffer(); + auto builder_contents = TRY(builder.try_to_byte_buffer()); TRY(m_socket->write(builder_contents)); while (!content.is_empty()) { @@ -319,8 +319,8 @@ ErrorOr Client::send_error_response(Error const& err header_builder.appendff("Content-Length: {}\r\n", content_builder.length()); header_builder.append("\r\n"sv); - TRY(m_socket->write(header_builder.to_byte_buffer())); - TRY(m_socket->write(content_builder.to_byte_buffer())); + TRY(m_socket->write(TRY(header_builder.try_to_byte_buffer()))); + TRY(m_socket->write(TRY(content_builder.try_to_byte_buffer()))); log_response(error.http_status); return {}; -- cgit v1.2.3