changeset 3267:b4f16bf59a5d

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]
author Thomas Arendsen Hein <thomas@intevation.de>
date Thu, 05 Oct 2006 11:57:38 +0200
parents 03880d4e2550
children bb057b6ce3cf
files mercurial/hgweb/hgweb_mod.py
diffstat 1 files changed, 2 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- 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 += '/'