diff options
author | Karol Baraniecki <karol@baraniecki.eu> | 2023-03-07 14:36:40 +0100 |
---|---|---|
committer | Linus Groh <mail@linusgroh.de> | 2023-03-09 12:59:57 +0000 |
commit | cd4804ed1caccbc097595ded31a4e2a7740d38fe (patch) | |
tree | 1361462d7dad34a70db038dbe81d543b50547f8a /Userland/Libraries/LibWeb | |
parent | f8e94f286280c4c6ed05c5490a7f55773adc491b (diff) | |
download | serenity-cd4804ed1caccbc097595ded31a4e2a7740d38fe.zip |
LibWeb: Use fallible version of StringBuilder::to_byte_buffer
Diffstat (limited to 'Userland/Libraries/LibWeb')
-rw-r--r-- | Userland/Libraries/LibWeb/WebDriver/Client.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
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<void, Client::WrappedError> 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<void, Client::WrappedError> 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<void, Client::WrappedError> 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 {}; |