# HG changeset patch # User wujek # Date 2011-08-01 07:48:10 # Node ID dd74cd1e5d49cdedfd2a0cf142a9ce1178e4b748 # Parent 68b5d7005cca68b3757d10aaa3164bf0647f624f hgweb: handle 'baseurl' configurations with leading slash (issue2934) diff --git a/mercurial/hgweb/hgwebdir_mod.py b/mercurial/hgweb/hgwebdir_mod.py --- a/mercurial/hgweb/hgwebdir_mod.py +++ b/mercurial/hgweb/hgwebdir_mod.py @@ -368,4 +368,7 @@ class hgwebdir(object): env['SERVER_NAME'] = u.host if u.port: env['SERVER_PORT'] = u.port - env['SCRIPT_NAME'] = '/' + u.path + path = u.path or "" + if not path.startswith('/'): + path = '/' + path + env['SCRIPT_NAME'] = path