diff mercurial/hgweb/request.py @ 36902:b2a3308d6a21

tests: add test coverage for parsing WSGI requests A subsequent commit will need to make this code more complicated in order to support alternate base URLs. Let's establish some test coverage before we diverge too far from PEP 3333. As part of this, a minor bug related to a missing SCRIPT_NAME key has been squashed. Differential Revision: https://phab.mercurial-scm.org/D2818
author Gregory Szorc <gregory.szorc@gmail.com>
date Sun, 11 Mar 2018 12:53:47 -0700
parents ccb70a77f746
children d7fd203e36cc
line wrap: on
line diff
--- a/mercurial/hgweb/request.py	Sun Mar 11 10:51:14 2018 -0700
+++ b/mercurial/hgweb/request.py	Sun Mar 11 12:53:47 2018 -0700
@@ -222,7 +222,7 @@
     # root. We also exclude its path components from PATH_INFO when resolving
     # the dispatch path.
 
-    apppath = env['SCRIPT_NAME']
+    apppath = env.get('SCRIPT_NAME', '')
 
     if env.get('REPO_NAME'):
         if not apppath.endswith('/'):