NPOS macro
This commit is contained in:
@@ -133,7 +133,7 @@ void Webserv::_append_body(Client *client, const std::string &body, const std::s
|
||||
else
|
||||
{
|
||||
client->response.append(mime_type);
|
||||
if (mime_type.find("text/") != std::string::npos)
|
||||
if (mime_type.find("text/") != NPOS)
|
||||
client->response.append("; charset=UTF-8");
|
||||
}
|
||||
client->response.append(CRLF);
|
||||
@@ -251,7 +251,7 @@ If we get a url that ends in / ignore the last /
|
||||
std::string Webserv::_determine_file_extension(const std::string &path) const
|
||||
{
|
||||
size_t dot_pos = path.rfind(".");
|
||||
if (dot_pos != std::string::npos && dot_pos + 1 < path.size())
|
||||
if (dot_pos != NPOS && dot_pos + 1 < path.size())
|
||||
return ( path.substr(dot_pos + 1) );
|
||||
return (std::string(""));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user