NPOS macro

This commit is contained in:
LuckyLaszlo
2022-08-12 18:16:49 +02:00
parent b44acafefe
commit c7bbf29a1b
9 changed files with 43 additions and 43 deletions

View File

@@ -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(""));
}