On Sun, Oct 05, 2008 at 01:49:29AM +0200, Justus Winter wrote:
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
Hey all :)
there were two problems preventing the use of numeric ipv6 literals:
1. splitting the authority in hostname and port
the attached patch fixes the handling of numeric ipv6 addresses entered into the url bar. a_Url_hostname got the colons delimiting the 8 groups of hexadecimal digits of an ipv6 address confused with a port number.
Committed to CVS (not in the already made release).
2. joining hostname and port for the Host: header
a_Http_make_query_str used to build the Host: header by concatenating the url->hostname with the port number in case it's not the default port. Unfortunately this breaks with numeric ipv6 addresses since an ipv6 literal has to be enclosed with square brackets when used in urls and Host: header fields (according to my experiments and my interpretation of rfc 2616 section 14.23 ("Host header") and 3.2.2 ("http URL")).
I would therefore suggest to use the original authority string obtained from the url. Patch is attached.
AFAIR, the "remove default port" part was added because some sites answer 404 when receiving it. I'd prefer a patch that handles IPv6 like you suggest, and IPv4 as now. -- Cheers Jorge.-