hgweb: replace PATH_INFO with dispatchpath
authorGregory Szorc <gregory.szorc@gmail.com>
Sun, 11 Mar 2018 15:18:29 -0700
changeset 36903 803e0fc0cc9a
parent 36902 e473a032f38a
child 36904 092ab4ba7ee5
hgweb: replace PATH_INFO with dispatchpath This was the last consumer of wsgireq.env from our WSGI applications! (Although indirect consumers of this attribute exist in wsgirequest.respond().) Differential Revision: https://phab.mercurial-scm.org/D2825
mercurial/hgweb/hgwebdir_mod.py
--- a/mercurial/hgweb/hgwebdir_mod.py	Sun Mar 11 15:15:02 2018 -0700
+++ b/mercurial/hgweb/hgwebdir_mod.py	Sun Mar 11 15:18:29 2018 -0700
@@ -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)