Skip to content

Commit 021f6cc

Browse files
committed
Fixed some clang compile warnings
1 parent d35ab99 commit 021f6cc

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

webserver/reply.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -327,10 +327,10 @@ bool reply::set_content_from_file(reply *rep, const std::string & file_path, con
327327
if (last_dot_pos != std::string::npos) {
328328
std::string file_extension = attachment.substr(last_dot_pos + 1);
329329
std::string mime_type = mime_types::extension_to_type(file_extension);
330-
if ((mime_type.find("text/") >= 0) ||
331-
(mime_type.find("/xml") >= 0) ||
332-
(mime_type.find("/javascript") >= 0) ||
333-
(mime_type.find("/json") >= 0)) {
330+
if ((mime_type.find("text/") != std::string::npos) ||
331+
(mime_type.find("/xml") != std::string::npos) ||
332+
(mime_type.find("/javascript") != std::string::npos) ||
333+
(mime_type.find("/json") != std::string::npos)) {
334334
// Add charset on text content
335335
mime_type += ";charset=UTF-8";
336336
}

0 commit comments

Comments
 (0)