From 087b16546e4b24f1db87c2334b83a272565e4dfd Mon Sep 17 00:00:00 2001 From: Talyx Date: Sat, 29 Jan 2022 14:16:41 +0300 Subject: [PATCH] static func getReasonPhrase() --- src/Client/Response.cpp | 2 ++ src/Client/Response.hpp | 8 ++++---- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/Client/Response.cpp b/src/Client/Response.cpp index c47b6e4..6fe6661 100644 --- a/src/Client/Response.cpp +++ b/src/Client/Response.cpp @@ -94,6 +94,8 @@ void Response::methodGet(void) //-------------------------------------------------GET/SET--------------------------------------- +std::map Response::_errorCode; + void Response::initErrorCode(void) { _errorCode["100"] = "Continue"; diff --git a/src/Client/Response.hpp b/src/Client/Response.hpp index 1cdad14..10fcb14 100644 --- a/src/Client/Response.hpp +++ b/src/Client/Response.hpp @@ -14,7 +14,7 @@ private: ServerConfig *_config; private: - std::map _errorCode; + static std::map _errorCode; private: void methodGet(void); @@ -25,15 +25,15 @@ private: public: std::string getClient(void); std::string getBody(void); - std::string getReasonPhrase(std::string); - std::string getReasonPhrase(int); + static std::string getReasonPhrase(std::string); + static std::string getReasonPhrase(int); std::string getErrorPage(int code); void setData(Request, ServerConfig *); public: void OpenResponseFile(const char *path); - void initErrorCode(void); + void initErrorCode(void); void generate(); Response(); ~Response();