-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Description
Given the following MediaType
multipart/mixed; boundary="MIME_boundary_01234567"
poco-1.9.4 > Poco::Net::MediaType::parse() does not split the boundary parameter,
because parse() does not advance past the semicolon before calling
Poco::Net::MessageHeader::splitParameters()
Some possible fixes might be
1.
void MediaType::parse(const std::string& mediaType)
{
_type.clear();
_subType.clear();
_parameters.clear();
std::string::const_iterator it = mediaType.begin();
std::string::const_iterator end = mediaType.end();
while (it != end && Poco::Ascii::isSpace(*it)) ++it;
while (it != end && *it != '/') _type += *it++;
if (it != end) ++it;
while (it != end && *it != ';' && !Poco::Ascii::isSpace(*it)) _subType += *it++;
// Changed next line to skip semicolons
// while (it != end && *it != ';') ++it;
while (it != end && *it == ';') ++it;
MessageHeader::splitParameters(it, end, _parameters);
}
void MediaType::parse(const std::string& mediaType)
{
_type.clear();
_subType.clear();
_parameters.clear();
std::string::const_iterator it = mediaType.begin();
std::string::const_iterator end = mediaType.end();
while (it != end && Poco::Ascii::isSpace(*it)) ++it;
while (it != end && *it != '/') _type += *it++;
if (it != end) ++it;
while (it != end && *it != ';' && !Poco::Ascii::isSpace(*it)) _subType += *it++;
while (it != end && *it != ';') ++it;
// Added next line to skip next character (i.e. semicolon)
if (it != end) ++it;
MessageHeader::splitParameters(it, end, _parameters);
}