# HG changeset patch # User Thomas Arendsen Hein # Date 2006-10-05 09:57:38 # Node ID b4f16bf59a5d26add9caaf192420af90a1dee55b # Parent 03880d4e2550588bf10e85b74e620ed282938887 hgweb: Added safety net for PATH_INFO starting with double slash. This happens e.g. when using the following apache config: RewriteRule (.*) /hgwebdir/$1 [PT] instead of the less readable (but more correct): RewriteRule (.*) /hgwebdir$1 [PT] diff --git a/mercurial/hgweb/hgweb_mod.py b/mercurial/hgweb/hgweb_mod.py --- a/mercurial/hgweb/hgweb_mod.py +++ b/mercurial/hgweb/hgweb_mod.py @@ -660,6 +660,8 @@ class hgweb(object): pi = req.env.get('PATH_INFO') if pi: + while pi.startswith('//'): + pi = pi[1:] if pi.startswith(base): if len(pi) > len(base): base += '/'