Bug 464162 - Apache does not accept IPv6 addresses with a scope id in the Host: header; r+sr=cbiesinger

This commit is contained in:
Masahiro Yamada 2008-12-06 14:15:24 +01:00
parent 4ef89e9db6
commit 2623c93663

View File

@ -222,7 +222,14 @@ nsHttpChannel::Init(nsIURI *uri,
if (strchr(host.get(), ':')) {
// host is an IPv6 address literal and must be encapsulated in []'s
hostLine.Assign('[');
hostLine.Append(host);
// scope id is not needed for Host header.
int scopeIdPos = host.FindChar('%');
if (scopeIdPos == kNotFound)
hostLine.Append(host);
else if (scopeIdPos > 0)
hostLine.Append(Substring(host, 0, scopeIdPos));
else
return NS_ERROR_MALFORMED_URI;
hostLine.Append(']');
}
else