Commit 6f894d2a authored by Tien Thinh NGUYEN's avatar Tien Thinh NGUYEN

Fix small issue for Mime parser for normal message

parent 8e94638a
...@@ -33,8 +33,10 @@ bool mime_parser::parse(const std::string& str) { ...@@ -33,8 +33,10 @@ bool mime_parser::parse(const std::string& str) {
// find boundary // find boundary
std::size_t content_type_pos = str.find("Content-Type"); // first part std::size_t content_type_pos = str.find("Content-Type"); // first part
// For normal message -> don't need to parse (number of parts = 0)
if ((content_type_pos <= 4) or (content_type_pos == std::string::npos)) if ((content_type_pos <= 4) or (content_type_pos == std::string::npos))
return false; return true;
std::string boundary_str = std::string boundary_str =
str.substr(2, content_type_pos - 4); // 2 for -- and 2 for CRLF str.substr(2, content_type_pos - 4); // 2 for -- and 2 for CRLF
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment