summaryrefslogtreecommitdiff
path: root/Userland/Services
diff options
context:
space:
mode:
authorTim Schumacher <timschumi@gmx.de>2023-01-30 11:05:43 +0100
committerLinus Groh <mail@linusgroh.de>2023-02-08 17:44:32 +0000
commit220fbcaa7e6ed087fa266b98a454ce1c06ea8100 (patch)
treeb155b42e299728dc672d2b5ce33b520a428cfb14 /Userland/Services
parent8b2f23d0166ec9d21a70f10dadb2d7533a161079 (diff)
downloadserenity-220fbcaa7e6ed087fa266b98a454ce1c06ea8100.zip
AK: Remove the fallible constructor from `FixedMemoryStream`
Diffstat (limited to 'Userland/Services')
-rw-r--r--Userland/Services/WebServer/Client.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/Userland/Services/WebServer/Client.cpp b/Userland/Services/WebServer/Client.cpp
index 269582af5f..beb497438b 100644
--- a/Userland/Services/WebServer/Client.cpp
+++ b/Userland/Services/WebServer/Client.cpp
@@ -336,8 +336,8 @@ ErrorOr<void> Client::handle_directory_listing(String const& requested_path, Str
builder.append("</html>\n"sv);
auto response = builder.to_deprecated_string();
- auto stream = TRY(FixedMemoryStream::construct(response.bytes()));
- return send_response(*stream, request, { .type = TRY(String::from_utf8("text/html"sv)), .length = response.length() });
+ FixedMemoryStream stream { response.bytes() };
+ return send_response(stream, request, { .type = TRY(String::from_utf8("text/html"sv)), .length = response.length() });
}
ErrorOr<void> Client::send_error_response(unsigned code, HTTP::HttpRequest const& request, Vector<String> const& headers)