hgweb: support broken IIS 5 behavior with .cgi in PATH_INFO
authorDirkjan Ochtman <dirkjan@ochtman.nl>
Tue, 25 Nov 2008 17:54:49 +0100
changeset 7406 ee8af8a4d905
parent 7405 f1944e74e83c
child 7407 7b2a77b20964
hgweb: support broken IIS 5 behavior with .cgi in PATH_INFO
mercurial/hgweb/wsgicgi.py
--- a/mercurial/hgweb/wsgicgi.py	Tue Nov 25 22:23:17 2008 +0100
+++ b/mercurial/hgweb/wsgicgi.py	Tue Nov 25 17:54:49 2008 +0100
@@ -17,6 +17,9 @@
 
     environ = dict(os.environ.items())
     environ.setdefault('PATH_INFO', '')
+    if '.cgi' in environ['PATH_INFO']:
+        environ['PATH_INFO'] = environ['PATH_INFO'].split('.cgi', 1)[1]
+
     environ['wsgi.input'] = sys.stdin
     environ['wsgi.errors'] = sys.stderr
     environ['wsgi.version'] = (1, 0)