wip, need somes changes in ConfigParser.
+ _determine_location() + http_method changes + http_method switch in _construct_response() + ConfigParser::_str_to_method_type() moved to global utils.cpp
This commit is contained in:
@@ -52,3 +52,35 @@ bool isNumeric_btw(int low, int high, std::string str)
|
||||
return true;
|
||||
}
|
||||
|
||||
http_method str_to_http_method(std::string &str)
|
||||
{
|
||||
if (str == "GET")
|
||||
return GET;
|
||||
else if (str == "POST")
|
||||
return POST;
|
||||
else if (str == "DELETE")
|
||||
return DELETE;
|
||||
return UNKNOWN;
|
||||
}
|
||||
|
||||
std::string http_methods_to_str(unsigned int methods)
|
||||
{
|
||||
std::string str;
|
||||
|
||||
if (methods & GET)
|
||||
str.append("GET");
|
||||
if (methods & POST)
|
||||
{
|
||||
if (!str.empty())
|
||||
str.append(", ");
|
||||
str.append("POST");
|
||||
}
|
||||
if (methods & DELETE)
|
||||
{
|
||||
if (!str.empty())
|
||||
str.append(", ");
|
||||
str.append("DELETE");
|
||||
}
|
||||
|
||||
return (str);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user