modified FSM so that the whitespace between header-key and value is optional
This commit is contained in:
parent
48be5a5622
commit
6d8cf826d7
@ -61,7 +61,6 @@ class RequestParser
|
|||||||
header_line_start,
|
header_line_start,
|
||||||
header_lws,
|
header_lws,
|
||||||
header_name,
|
header_name,
|
||||||
space_before_header_value,
|
|
||||||
header_value,
|
header_value,
|
||||||
expecting_newline_2,
|
expecting_newline_2,
|
||||||
expecting_newline_3
|
expecting_newline_3
|
||||||
|
@ -217,7 +217,7 @@ RequestParser::RequestStatus RequestParser::consume(http::request ¤t_reque
|
|||||||
case internal_state::header_name:
|
case internal_state::header_name:
|
||||||
if (input == ':')
|
if (input == ':')
|
||||||
{
|
{
|
||||||
state = internal_state::space_before_header_value;
|
state = internal_state::header_value;
|
||||||
return RequestStatus::indeterminate;
|
return RequestStatus::indeterminate;
|
||||||
}
|
}
|
||||||
if (!is_char(input) || is_CTL(input) || is_special(input))
|
if (!is_char(input) || is_CTL(input) || is_special(input))
|
||||||
@ -226,14 +226,12 @@ RequestParser::RequestStatus RequestParser::consume(http::request ¤t_reque
|
|||||||
}
|
}
|
||||||
current_header.name.push_back(input);
|
current_header.name.push_back(input);
|
||||||
return RequestStatus::indeterminate;
|
return RequestStatus::indeterminate;
|
||||||
case internal_state::space_before_header_value:
|
case internal_state::header_value:
|
||||||
if (input == ' ')
|
if (input == ' ')
|
||||||
{
|
{
|
||||||
state = internal_state::header_value;
|
state = internal_state::header_value;
|
||||||
return RequestStatus::indeterminate;
|
return RequestStatus::indeterminate;
|
||||||
}
|
}
|
||||||
return RequestStatus::invalid;
|
|
||||||
case internal_state::header_value:
|
|
||||||
if (input == '\r')
|
if (input == '\r')
|
||||||
{
|
{
|
||||||
state = internal_state::expecting_newline_2;
|
state = internal_state::expecting_newline_2;
|
||||||
|
Loading…
Reference in New Issue
Block a user