Mercurial > public > mercurial-scm > hg
comparison mercurial/hgweb/hgweb_mod.py @ 4339:26a2fa9433b8
hgweb: make PATH_INFO handling slightly more robust
author | Matt Mackall <mpm@selenic.com> |
---|---|
date | Thu, 12 Apr 2007 11:00:21 -0500 |
parents | 7843528a7922 |
children | c593e502f7fd b633f470944e |
comparison
equal
deleted
inserted
replaced
4334:66a3fe30f9fc | 4339:26a2fa9433b8 |
---|---|
714 pi = normurl(req.env.get('PATH_INFO', '')) | 714 pi = normurl(req.env.get('PATH_INFO', '')) |
715 if pi: | 715 if pi: |
716 # strip leading / | 716 # strip leading / |
717 pi = pi[1:] | 717 pi = pi[1:] |
718 if pi: | 718 if pi: |
719 root = root[:-len(pi)] | 719 root = root[:root.rfind(root, pi)] |
720 if req.env.has_key('REPO_NAME'): | 720 if req.env.has_key('REPO_NAME'): |
721 rn = req.env['REPO_NAME'] + '/' | 721 rn = req.env['REPO_NAME'] + '/' |
722 root += rn | 722 root += rn |
723 query = pi[len(rn):] | 723 query = pi[len(rn):] |
724 else: | 724 else: |