hgweb: escape REMOTE_HOST when passing url for addchangegroup
If DNS lookups are turned off on the web server, REMOTE_HOST may be
populated with REMOTE_ADDR, which, if the remote is an IPv6 hosts will
contain colons, thus interfering with the separator character. This is
solved by URL quoting the REMOTE_HOST string.
--- a/mercurial/hgweb/protocol.py Fri Jun 19 14:00:41 2009 +0200
+++ b/mercurial/hgweb/protocol.py Sun Jun 07 20:15:37 2009 +0200
@@ -163,7 +163,8 @@
try:
url = 'remote:%s:%s' % (proto,
- req.env.get('REMOTE_HOST', ''))
+ urllib.quote(
+ req.env.get('REMOTE_HOST', '')))
try:
ret = repo.addchangegroup(gen, 'serve', url)
except util.Abort, inst: