diff --git a/Userland/Libraries/LibWeb/WebDriver/Client.cpp b/Userland/Libraries/LibWeb/WebDriver/Client.cpp index 7887f1f0d28..4868370b908 100644 --- a/Userland/Libraries/LibWeb/WebDriver/Client.cpp +++ b/Userland/Libraries/LibWeb/WebDriver/Client.cpp @@ -303,14 +303,9 @@ ErrorOr Client::send_success_response(JsonValue resu builder.append("Content-Type: application/json; charset=utf-8\r\n"sv); builder.appendff("Content-Length: {}\r\n", content.length()); builder.append("\r\n"sv); + builder.append(content); - auto builder_contents = TRY(builder.to_byte_buffer()); - TRY(m_socket->write_until_depleted(builder_contents)); - - while (!content.is_empty()) { - auto bytes_sent = TRY(m_socket->write_some(content.bytes())); - content = content.substring_view(bytes_sent); - } + TRY(m_socket->write_until_depleted(builder.string_view())); if (!keep_alive) die();