Skip to content

Commit a5a8d9f

Browse files
committed
Fix: Failed to parse request/response header without any header-fields
1 parent 510b338 commit a5a8d9f

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/http_header_parser.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,9 @@ http_headers_container http_header_parser::parse_headers(std::string::const_iter
147147
header_field_name.push_back(*iter);
148148
state = parse_header_state::header_field_name;
149149
}
150+
else if (iter == begin && *iter == '\r') {
151+
state = parse_header_state::header_field_crlfcr;
152+
}
150153
else {
151154
state = parse_header_state::header_parse_failed;
152155
}

0 commit comments

Comments
 (0)