diff --git a/http_parser.c b/http_parser.c index 48963853..7e268d82 100644 --- a/http_parser.c +++ b/http_parser.c @@ -2326,7 +2326,6 @@ http_parse_host(const char * buf, struct http_parser_url *u, int found_at) { case s_http_host_v6: case s_http_host_v6_zone_start: case s_http_host_v6_zone: - case s_http_host_port_start: case s_http_userinfo: case s_http_userinfo_start: return 1; diff --git a/test.c b/test.c index 0140a18b..54eca61c 100644 --- a/test.c +++ b/test.c @@ -2825,6 +2825,25 @@ const struct url_test url_tests[] = ,.rv=0 } +, {.name="proxy empty port" + ,.url="http://hostname:/" + ,.is_connect=0 + ,.u= + {.field_set=(1 << UF_SCHEMA) | (1 << UF_HOST) | (1 << UF_PATH) + ,.port=0 + ,.field_data= + {{ 0, 4 } /* UF_SCHEMA */ + ,{ 7, 8 } /* UF_HOST */ + ,{ 0, 0 } /* UF_PORT */ + ,{ 16, 1 } /* UF_PATH */ + ,{ 0, 0 } /* UF_QUERY */ + ,{ 0, 0 } /* UF_FRAGMENT */ + ,{ 0, 0 } /* UF_USERINFO */ + } + } + ,.rv=0 + } + , {.name="CONNECT request" ,.url="hostname:443" ,.is_connect=1 @@ -3059,12 +3078,6 @@ const struct url_test url_tests[] = ,.rv=1 } -, {.name="proxy empty port" - ,.url="http://hostname:/" - ,.is_connect=0 - ,.rv=1 - } - , {.name="CONNECT with basic auth" ,.url="a:b@hostname:443" ,.is_connect=1