diff --git a/include/http.hpp b/include/http.hpp index b3d2825..3f2b68f 100644 --- a/include/http.hpp +++ b/include/http.hpp @@ -14,4 +14,6 @@ public: static void bad_json(std::shared_ptr response); static void bad_object(std::shared_ptr response); static void bad_object(std::shared_ptr response); + static void not_found(std::shared_ptr response); + static void not_found(std::shared_ptr response); }; \ No newline at end of file diff --git a/src/http.cpp b/src/http.cpp index 927c756..e0b0d12 100644 --- a/src/http.cpp +++ b/src/http.cpp @@ -48,3 +48,11 @@ void response::bad_object(std::shared_ptr response) { bad_object_msg.dump(), {header_access_control, header_application_data}); } + +void response::not_found(std::shared_ptr response) { + return response->write(Status::client_error_not_found); +} + +void response::not_found(std::shared_ptr response) { + return response->write(Status::client_error_not_found); +} \ No newline at end of file diff --git a/src/store.cpp b/src/store.cpp index a0d2763..fcfcfcf 100644 --- a/src/store.cpp +++ b/src/store.cpp @@ -59,11 +59,7 @@ int Application::run() { http_server.default_resource["GET"] = [&](std::shared_ptr response, ...) { - if (https_server) { - return response::https_required(response); - } - response->write(Status::success_ok, store.dump(), - {header_access_control, header_application_data}); + return response::not_found(response); }; http_server.default_resource["POST"] =