mercurial/hgweb/hgweb_mod.py
changeset 36898 d0b0fedbfb53
parent 36887 4daa22071d5d
child 36909 84110a1d0f7d
--- a/mercurial/hgweb/hgweb_mod.py	Sun Mar 11 13:11:13 2018 -0700
+++ b/mercurial/hgweb/hgweb_mod.py	Sun Mar 11 13:38:56 2018 -0700
@@ -324,7 +324,11 @@
         if handled:
             return res.sendresponse()
 
-        if req.havepathinfo:
+        # Old implementations of hgweb supported dispatching the request via
+        # the initial query string parameter instead of using PATH_INFO.
+        # If PATH_INFO is present (signaled by ``req.dispatchpath`` having
+        # a value), we use it. Otherwise fall back to the query string.
+        if req.dispatchpath is not None:
             query = req.dispatchpath
         else:
             query = req.querystring.partition('&')[0].partition(';')[0]