httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Colm MacCárthaigh <c...@allcosts.net>
Subject Re: Should ap_get_server_name() behave like get_server_name_for_url() for literal IPv6 addresses?
Date Fri, 08 Jan 2010 20:28:37 GMT
On Tue, Dec 22, 2009 at 9:54 PM, Stefan Fritsch <sf@sfritsch.de> wrote:
> mod_rewrite incorrectly omits the brackets around literal IPv6
> addresses in redirects. Similar issues have been fixed at other places
> in the code already. In server/core.c there is
> get_server_name_for_url(), a wrapper around ap_get_server_name, which
> adds the brackets.

IPv6 addresses do have brackets in URLs, because colon is a port separator too,

...

> mod_proxy_http:
> via header (should have brackets)
>
> ssl_engine_kernel.c:
> error message url (should have brackets)
>
> mod_rewrite:
> redirects (should have brackets)
> logging (doesn't matter)
> SERVER_NAME variable

Redirects should have brackets yes ... but I don't think that it's the
job of the SERVER_NAME variable to anticipate potential use in a url,
it's just a representation of an IPv6 address. Introducing braces
would break reverse DNS lookups, for one thing.

> I guess many scripts don't have a special case for IPv6 literals. I
> think having the brackets in the SERVER_NAME variable would be better.
> Is there some spec how this should be?

I think encoding as per RFC3513 Section 2.2 is best :-)

-- 
Colm

Mime
View raw message