diff options
Diffstat (limited to 'zenserver/testing')
| -rw-r--r-- | zenserver/testing/httptest.cpp | 13 | ||||
| -rw-r--r-- | zenserver/testing/httptest.h | 7 | ||||
| -rw-r--r-- | zenserver/testing/launch.cpp | 6 |
3 files changed, 5 insertions, 21 deletions
diff --git a/zenserver/testing/httptest.cpp b/zenserver/testing/httptest.cpp index 0639c2b53..653f76046 100644 --- a/zenserver/testing/httptest.cpp +++ b/zenserver/testing/httptest.cpp @@ -8,18 +8,16 @@ HttpTestingService::HttpTestingService() { m_Router.RegisterRoute( "hello", - [this](HttpRouterRequest& Req) { Req.ServerRequest().WriteResponse(HttpResponse::OK); }, + [this](HttpRouterRequest& Req) { Req.ServerRequest().WriteResponse(HttpResponseCode::OK); }, HttpVerb::kGet); m_Router.RegisterRoute( "echo", [this](HttpRouterRequest& Req) { IoBuffer Body = Req.ServerRequest().ReadPayload(); - Req.ServerRequest().WriteResponse(HttpResponse::OK, HttpContentType::kBinary, Body); + Req.ServerRequest().WriteResponse(HttpResponseCode::OK, HttpContentType::kBinary, Body); }, HttpVerb::kPost); - - m_Router.RegisterRoute("package", m_PackageHandler); } HttpTestingService::~HttpTestingService() @@ -38,11 +36,4 @@ HttpTestingService::HandleRequest(HttpServerRequest& Request) m_Router.HandleRequest(Request); } -void -HttpTestingService::PackageHandler::HandleRequest(HttpRouterRequest& Req) -{ - IoBuffer Body = Req.ServerRequest().ReadPayload(); - Req.ServerRequest().WriteResponse(HttpResponse::OK, HttpContentType::kBinary, Body); -} - } // namespace zen diff --git a/zenserver/testing/httptest.h b/zenserver/testing/httptest.h index 696543616..18652db71 100644 --- a/zenserver/testing/httptest.h +++ b/zenserver/testing/httptest.h @@ -22,13 +22,6 @@ public: private: HttpRequestRouter m_Router; - - struct PackageHandler : public PackageEndpointHandler - { - virtual void HandleRequest(HttpRouterRequest& Request) override; - }; - - PackageHandler m_PackageHandler; }; } // namespace zen diff --git a/zenserver/testing/launch.cpp b/zenserver/testing/launch.cpp index d06fae3e2..b031193d5 100644 --- a/zenserver/testing/launch.cpp +++ b/zenserver/testing/launch.cpp @@ -409,7 +409,7 @@ HttpLaunchService::HttpLaunchService(CasStore& Store, const std::filesystem::pat Cbo.EndArray(); CbObject Response = Cbo.Save(); - return HttpReq.WriteResponse(HttpResponse::OK, Response); + return HttpReq.WriteResponse(HttpResponseCode::OK, Response); } break; } @@ -470,7 +470,7 @@ HttpLaunchService::HttpLaunchService(CasStore& Store, const std::filesystem::pat if (!AllOk) { // TODO: Could report all the missing pieces in the response here - return HttpReq.WriteResponse(HttpResponse::NotFound); + return HttpReq.WriteResponse(HttpResponseCode::NotFound); } std::string Executable8{RequestObject["cmd"].AsString()}; @@ -492,7 +492,7 @@ HttpLaunchService::HttpLaunchService(CasStore& Store, const std::filesystem::pat Response << "exitcode" << Job.ExitCode(); - return HttpReq.WriteResponse(HttpResponse::OK, Response.Save()); + return HttpReq.WriteResponse(HttpResponseCode::OK, Response.Save()); } break; } |