Patchwork D2825: hgweb: replace PATH_INFO with dispatchpath

login
register
mail settings
Submitter phabricator
Date March 12, 2018, 9:16 p.m.
Message ID <differential-rev-PHID-DREV-j7in4b344bz6rsv2yvaq-req@phab.mercurial-scm.org>
Download mbox | patch
Permalink /patch/29335/
State Superseded
Headers show

Comments

phabricator - March 12, 2018, 9:16 p.m.
indygreg created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REVISION SUMMARY
  This was the last consumer of wsgireq.env from our WSGI applications!
  
  (Although indirect consumers of this attribute exist in
  wsgirequest.respond().)

REPOSITORY
  rHG Mercurial

REVISION DETAIL
  https://phab.mercurial-scm.org/D2825

AFFECTED FILES
  mercurial/hgweb/hgwebdir_mod.py

CHANGE DETAILS




To: indygreg, #hg-reviewers
Cc: mercurial-devel

Patch

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
@@ -369,7 +369,7 @@ 
                 res.headers['Content-Security-Policy'] = csp
                 wsgireq.headers.append(('Content-Security-Policy', csp))
 
-            virtual = wsgireq.env.get("PATH_INFO", "").strip('/')
+            virtual = req.dispatchpath.strip('/')
             tmpl = self.templater(wsgireq, nonce)
             ctype = tmpl('mimetype', encoding=encoding.encoding)
             ctype = templater.stringify(ctype)