error parsing ipv6 [2001:0000:0000:0000:0000:0000:1.9.1.1] #133

Closed
dragosss opened this Issue Nov 15, 2012 · 2 comments

2 participants

@dragosss

for a request http://[2001:0000:0000:0000:0000:0000:1.9.1.1], http-parser takes as Host
2001:0000:0000:0000:0000:0000:1 and not entirely 2001:0000:0000:0000:0000:0000:1.9.1.1

this is because in http_parser.c file, http_parse_host_char(enum http_host_state s, const char ch) function, line 1965 we have:

if (IS_HEX(ch) || ch == ':')

and we should have

if (IS_HEX(ch) || ch == ':' || ch == '.')

@bnoordhuis
Node.js Foundation member

Duly noted. Want to send in a patch?

@cmr cmr added a commit to cmr/http-parser that referenced this issue Dec 4, 2012
@cmr cmr Add test for #133 ffd1f4b
@cmr cmr added a commit to cmr/http-parser that referenced this issue Dec 4, 2012
@cmr cmr Add fix for #133 62593f0
@bnoordhuis bnoordhuis added a commit that closed this issue Dec 5, 2012
@cmr cmr Fix IPv6 address parsing.
Fixes #133.
1c7f8ca
@bnoordhuis bnoordhuis closed this in 1c7f8ca Dec 5, 2012
@bnoordhuis
Node.js Foundation member

Fixed in 1c7f8ca.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment