diff --git a/http_parser.c b/http_parser.c index 95fa864..7556d92 100644 --- a/http_parser.c +++ b/http_parser.c @@ -687,6 +687,9 @@ size_t http_parser_execute (http_parser *parser, if (ch == ':') { state = s_req_schema_slash; break; + } else if (ch == '.') { + state = s_req_host; + break; } goto error; diff --git a/test.c b/test.c index 5d9e589..a9746ad 100644 --- a/test.c +++ b/test.c @@ -495,6 +495,30 @@ const struct message requests[] = ,.body= "" } +#define CONNECT_REQUEST 17 +, {.name = "connect request" + ,.type= HTTP_REQUEST + ,.raw= "CONNECT home.netscape.com:443 HTTP/1.0\r\n" + "User-agent: Mozilla/1.1N\r\n" + "Proxy-authorization: basic aGVsbG86d29ybGQ=\r\n" + "\r\n" + ,.should_keep_alive= FALSE + ,.message_complete_on_eof= FALSE + ,.http_major= 1 + ,.http_minor= 0 + ,.method= HTTP_CONNECT + ,.query_string= "" + ,.fragment= "" + ,.request_path= "" + ,.request_url= "home.netscape.com:443" + ,.num_headers= 2 + ,.upgrade=0 + ,.headers= { { "User-agent", "Mozilla/1.1N" } + , { "Proxy-authorization", "basic aGVsbG86d29ybGQ=" } + } + ,.body= "" + } + , {.name= NULL } /* sentinel */ };