# HG changeset patch # User Henrik Stuart # Date 1244398537 -7200 # Node ID 296767acbb55423849e51f698144bcb6c06404aa # Parent d2ef4f2b904a99afe5dcf2d5f8d272823e578dee 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. diff -r d2ef4f2b904a -r 296767acbb55 mercurial/hgweb/protocol.py --- 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: