Content Type validation added
This commit is contained in:
parent
a87d89302f
commit
daa6d02887
@ -60,7 +60,7 @@ RequestParser::parse(request ¤t_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 ¤t_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')
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user