diff --git a/core/http/web_root.cpp b/core/http/web_root.cpp index 6cdffae..101ba82 100644 --- a/core/http/web_root.cpp +++ b/core/http/web_root.cpp @@ -91,8 +91,8 @@ bool WebRoot::try_send_wwwroot_file(Request *request) { return false; } -void WebRoot::send_file(const std::string &path, Request *request) { - std::string fp = FileCache::get_singleton()->wwwroot + path; +void WebRoot::send_file(const String &path, Request *request) { + String fp = FileCache::get_singleton()->wwwroot + path; request->send_file(fp); } @@ -138,5 +138,5 @@ WebRoot::~WebRoot() { _middlewares.clear(); } -std::string WebRoot::default_error_404_body = "404 :("; -std::string WebRoot::default_generic_error_body = "Internal server error! :("; +String WebRoot::default_error_404_body = "404 :("; +String WebRoot::default_generic_error_body = "Internal server error! :("; diff --git a/core/http/web_root.h b/core/http/web_root.h index bee8395..89e421a 100644 --- a/core/http/web_root.h +++ b/core/http/web_root.h @@ -5,7 +5,7 @@ #include "mutex" #include #include -#include +#include "core/string.h" #include "web_router_node.h" @@ -14,25 +14,20 @@ class Request; // FileCache -> set up, for this webroot, don't use singleton - -// remove handler instances! - // Update the rest of the modules to the new systems -//remove std::strings - class WebRoot : public WebRouterNode { RCPP_OBJECT(WebRoot, WebRouterNode); public: - static std::string default_error_404_body; - static std::string default_generic_error_body; + static String default_error_404_body; + static String default_generic_error_body; void handle_request_main(Request *request); void handle_error_send_request(Request *request, const int error_code); bool try_send_wwwroot_file(Request *request); - void send_file(const std::string &path, Request *request); + void send_file(const String &path, Request *request); static void default_fallback_error_handler(Request *request, int error_code); static void default_404_error_handler(Request *request, int error_code);