Merge pull request #5608 from mariusre/http_parsing_fix

made whitespace between Header-key and value otional
This commit is contained in:
Lev Dragunov 2019-12-18 11:32:00 +03:00 committed by GitHub
commit 15f0ca8dda
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 3 additions and 5 deletions

View File

@ -11,6 +11,7 @@
- ADDED: flatbuffers output format support [#5513](https://github.com/Project-OSRM/osrm-backend/pull/5513) - ADDED: flatbuffers output format support [#5513](https://github.com/Project-OSRM/osrm-backend/pull/5513)
- ADDED: Global 'skip_waypoints' option [#5556](https://github.com/Project-OSRM/osrm-backend/pull/5556) - ADDED: Global 'skip_waypoints' option [#5556](https://github.com/Project-OSRM/osrm-backend/pull/5556)
- FIXED: Install the libosrm_guidance library correctly [#5604](https://github.com/Project-OSRM/osrm-backend/pull/5604) - FIXED: Install the libosrm_guidance library correctly [#5604](https://github.com/Project-OSRM/osrm-backend/pull/5604)
- FIXED: Http Handler can now deal witch optional whitespace between header-key and -value [#5606](https://github.com/Project-OSRM/osrm-backend/issues/5606)
- Routing: - Routing:
- CHANGED: allow routing past `barrier=arch` [#5352](https://github.com/Project-OSRM/osrm-backend/pull/5352) - CHANGED: allow routing past `barrier=arch` [#5352](https://github.com/Project-OSRM/osrm-backend/pull/5352)
- CHANGED: default car weight was reduced to 2000 kg. [#5371](https://github.com/Project-OSRM/osrm-backend/pull/5371) - CHANGED: default car weight was reduced to 2000 kg. [#5371](https://github.com/Project-OSRM/osrm-backend/pull/5371)

View File

@ -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

View File

@ -217,7 +217,7 @@ RequestParser::RequestStatus RequestParser::consume(http::request &current_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 &current_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;