Fix IPv6 address parsing.

Fixes #133.
make-http-max-header-size-gyp-configurable
Corey Richardson 12 years ago committed by Ben Noordhuis
parent cd01361819
commit 1c7f8cac9e

@ -1962,7 +1962,7 @@ http_parse_host_char(enum http_host_state s, const char ch) {
/* FALLTHROUGH */ /* FALLTHROUGH */
case s_http_host_v6_start: case s_http_host_v6_start:
if (IS_HEX(ch) || ch == ':') { if (IS_HEX(ch) || ch == ':' || ch == '.') {
return s_http_host_v6; return s_http_host_v6;
} }

@ -2214,6 +2214,25 @@ const struct url_test url_tests[] =
,.rv=0 ,.rv=0
} }
, {.name="ipv4 in ipv6 address"
,.url="http://[2001:0000:0000:0000:0000:0000:1.9.1.1]/"
,.is_connect=0
,.u=
{.field_set=(1 << UF_SCHEMA) | (1 << UF_HOST) | (1 << UF_PATH)
,.port=0
,.field_data=
{{ 0, 4 } /* UF_SCHEMA */
,{ 8, 37 } /* UF_HOST */
,{ 0, 0 } /* UF_PORT */
,{ 46, 1 } /* UF_PATH */
,{ 0, 0 } /* UF_QUERY */
,{ 0, 0 } /* UF_FRAGMENT */
,{ 0, 0 } /* UF_USERINFO */
}
}
,.rv=0
}
, {.name="extra ? in query string" , {.name="extra ? in query string"
,.url="http://a.tbcdn.cn/p/fp/2010c/??fp-header-min.css,fp-base-min.css," ,.url="http://a.tbcdn.cn/p/fp/2010c/??fp-header-min.css,fp-base-min.css,"
"fp-channel-min.css,fp-product-min.css,fp-mall-min.css,fp-category-min.css," "fp-channel-min.css,fp-product-min.css,fp-mall-min.css,fp-category-min.css,"

Loading…
Cancel
Save