summaryrefslogtreecommitdiff
path: root/Userland/Services/WebServer
diff options
context:
space:
mode:
authorLinus Groh <mail@linusgroh.de>2023-03-09 15:00:14 +0000
committerLinus Groh <mail@linusgroh.de>2023-03-09 15:51:00 +0000
commite76394d96c6242970b379c7f98d6ab1d08e16d40 (patch)
tree08e21656fc2b295ad71b0d3db79fb2cdade379d0 /Userland/Services/WebServer
parentad5e8f274219e716c2eb60d974bd835435587209 (diff)
downloadserenity-e76394d96c6242970b379c7f98d6ab1d08e16d40.zip
AK: Remove infallible version of StringBuilder::to_byte_buffer
Also drop the try_ prefix from the fallible function, as it is no longer needed to distinguish the two.
Diffstat (limited to 'Userland/Services/WebServer')
-rw-r--r--Userland/Services/WebServer/Client.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/Userland/Services/WebServer/Client.cpp b/Userland/Services/WebServer/Client.cpp
index c68dc720ea..45e5c9cdb0 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.try_to_byte_buffer().release_value_but_fixme_should_propagate_errors();
+ auto request = builder.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);
@@ -191,7 +191,7 @@ ErrorOr<void> Client::send_response(Stream& response, HTTP::HttpRequest const& r
builder.appendff("Content-Length: {}\r\n", content_info.length);
builder.append("\r\n"sv);
- auto builder_contents = TRY(builder.try_to_byte_buffer());
+ auto builder_contents = TRY(builder.to_byte_buffer());
TRY(m_socket->write(builder_contents));
log_response(200, request);
@@ -233,7 +233,7 @@ ErrorOr<void> Client::send_redirect(StringView redirect_path, HTTP::HttpRequest
builder.append("\r\n"sv);
builder.append("\r\n"sv);
- auto builder_contents = TRY(builder.try_to_byte_buffer());
+ auto builder_contents = TRY(builder.to_byte_buffer());
TRY(m_socket->write(builder_contents));
log_response(301, request);
@@ -363,8 +363,8 @@ ErrorOr<void> Client::send_error_response(unsigned code, HTTP::HttpRequest const
header_builder.append("Content-Type: text/html; charset=UTF-8\r\n"sv);
header_builder.appendff("Content-Length: {}\r\n", content_builder.length());
header_builder.append("\r\n"sv);
- TRY(m_socket->write(TRY(header_builder.try_to_byte_buffer())));
- TRY(m_socket->write(TRY(content_builder.try_to_byte_buffer())));
+ TRY(m_socket->write(TRY(header_builder.to_byte_buffer())));
+ TRY(m_socket->write(TRY(content_builder.to_byte_buffer())));
log_response(code, request);
return {};