# HG changeset patch # User Thomas Arendsen Hein # Date 1160042258 -7200 # 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 -r 03880d4e2550 -r b4f16bf59a5d mercurial/hgweb/hgweb_mod.py --- a/mercurial/hgweb/hgweb_mod.py Thu Oct 05 10:15:22 2006 +0200 +++ b/mercurial/hgweb/hgweb_mod.py Thu Oct 05 11:57:38 2006 +0200 @@ -660,6 +660,8 @@ pi = req.env.get('PATH_INFO') if pi: + while pi.startswith('//'): + pi = pi[1:] if pi.startswith(base): if len(pi) > len(base): base += '/'