diff --git a/http_parser.c b/http_parser.c index fc4f2321..88779593 100644 --- a/http_parser.c +++ b/http_parser.c @@ -1230,8 +1230,6 @@ size_t http_parser_execute (http_parser *parser, state = s_header_value; index = 0; - c = LOWER(ch); - if (ch == CR) { CALLBACK(header_value); header_state = h_general; @@ -1245,6 +1243,8 @@ size_t http_parser_execute (http_parser *parser, break; } + c = LOWER(ch); + switch (header_state) { case h_upgrade: parser->flags |= F_UPGRADE; @@ -1286,7 +1286,6 @@ size_t http_parser_execute (http_parser *parser, case s_header_value: { - c = LOWER(ch); if (ch == CR) { CALLBACK(header_value); @@ -1299,6 +1298,8 @@ size_t http_parser_execute (http_parser *parser, goto header_almost_done; } + c = LOWER(ch); + switch (header_state) { case h_general: break;