Content Type validation added

This commit is contained in:
Andreas Gruß 2015-06-01 09:42:22 +02:00
parent a87d89302f
commit daa6d02887

View File

@ -60,7 +60,7 @@ RequestParser::parse(request &current_request, char *begin, char *end)
}
osrm::tribool result = osrm::tribool::indeterminate;
if(is_post_header && content_length == 0)
if(state == internal_state::post_request && content_length <= 0)
{
result = osrm::tribool::yes;
}
@ -252,6 +252,13 @@ osrm::tribool RequestParser::consume(request &current_request, const char input)
// Ignore the header if the parameter isn't an int
}
}
if (boost::iequals(current_header.name, "Content-Type"))
{
if (!boost::icontains(current_header.value, "application/x-www-form-urlencoded"))
{
return osrm::tribool::no;
}
}
if (input == '\r')
{