diff options
author | Andreas Kling <kling@serenityos.org> | 2020-12-19 17:38:33 +0100 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2020-12-19 18:29:13 +0100 |
commit | 48d74c53565f6bd87e70430ea5b0bc7e6dedb957 (patch) | |
tree | f144a49e40fdc65f7056dc56417c347628dcb51c /Services | |
parent | e517505e35997d3e707b2332be57c5662b330674 (diff) | |
download | serenity-48d74c53565f6bd87e70430ea5b0bc7e6dedb957.zip |
LibHTTP: Make HTTPRequest::from_raw_request() take a ReadonlyBytes
This allows us to get rid of some ByteBuffer::wrap() usage.
Diffstat (limited to 'Services')
-rw-r--r-- | Services/WebServer/Client.cpp | 4 | ||||
-rw-r--r-- | Services/WebServer/Client.h | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/Services/WebServer/Client.cpp b/Services/WebServer/Client.cpp index 6e8f10dba4..deb582e013 100644 --- a/Services/WebServer/Client.cpp +++ b/Services/WebServer/Client.cpp @@ -65,12 +65,12 @@ void Client::start() dbg() << "Got raw request: '" << String::copy(raw_request) << "'"; - handle_request(move(raw_request)); + handle_request(raw_request.bytes()); die(); }; } -void Client::handle_request(ByteBuffer raw_request) +void Client::handle_request(ReadonlyBytes raw_request) { auto request_or_error = HTTP::HttpRequest::from_raw_request(raw_request); if (!request_or_error.has_value()) diff --git a/Services/WebServer/Client.h b/Services/WebServer/Client.h index 6b078bb568..f363c9d9eb 100644 --- a/Services/WebServer/Client.h +++ b/Services/WebServer/Client.h @@ -41,7 +41,7 @@ public: private: Client(NonnullRefPtr<Core::TCPSocket>, const String&, Core::Object* parent); - void handle_request(ByteBuffer); + void handle_request(ReadonlyBytes); void send_response(StringView, const HTTP::HttpRequest&, const String& content_type); void send_redirect(StringView redirect, const HTTP::HttpRequest& request); void send_error_response(unsigned code, const StringView& message, const HTTP::HttpRequest&); |