diff options
| author | Stefan Boberg <[email protected]> | 2023-10-04 13:13:23 +0200 |
|---|---|---|
| committer | GitHub <[email protected]> | 2023-10-04 13:13:23 +0200 |
| commit | 3e8db7cd243e8be3b2d5fea2490b9ad70f765590 (patch) | |
| tree | c1533ae25b0b717dd2393960c5449aadd56807c4 /src/zenhttp/testing | |
| parent | factored out http parser from asio into separate files (#444) (diff) | |
| download | zen-3e8db7cd243e8be3b2d5fea2490b9ad70f765590.tar.xz zen-3e8db7cd243e8be3b2d5fea2490b9ad70f765590.zip | |
removed websocket protocol support(#445)
removed websocket support since it is not used right now and is unlikely to be used in the future
Diffstat (limited to 'src/zenhttp/testing')
| -rw-r--r-- | src/zenhttp/testing/httptest.cpp | 32 |
1 files changed, 0 insertions, 32 deletions
diff --git a/src/zenhttp/testing/httptest.cpp b/src/zenhttp/testing/httptest.cpp index a02e36bcc..3a0ad72a9 100644 --- a/src/zenhttp/testing/httptest.cpp +++ b/src/zenhttp/testing/httptest.cpp @@ -140,38 +140,6 @@ HttpTestingService::HandlePackageRequest(HttpServerRequest& HttpServiceRequest) return (InsertResult.first->second = Ref<PackageHandler>(new PackageHandler(*this, RequestId))); } -void -HttpTestingService::RegisterHandlers(WebSocketServer& Server) -{ - Server.RegisterRequestHandler("SayHello"sv, *this); -} - -bool -HttpTestingService::HandleRequest(const WebSocketMessage& RequestMsg) -{ - CbObjectView Request = RequestMsg.Body().GetObject(); - - std::string_view Method = Request["Method"].AsString(); - - if (Method != "SayHello"sv) - { - return false; - } - - CbObjectWriter Response; - Response.AddString("Result"sv, "Hello Friend!!"); - - WebSocketMessage ResponseMsg; - ResponseMsg.SetMessageType(WebSocketMessageType::kResponse); - ResponseMsg.SetCorrelationId(RequestMsg.CorrelationId()); - ResponseMsg.SetSocketId(RequestMsg.SocketId()); - ResponseMsg.SetBody(Response.Save()); - - SocketServer().SendResponse(std::move(ResponseMsg)); - - return true; -} - ////////////////////////////////////////////////////////////////////////// HttpTestingService::PackageHandler::PackageHandler(HttpTestingService& Svc, uint32_t RequestId) : m_Svc(Svc), m_RequestId(RequestId) |