changeset 10202:dcaa80294c79

Merge with crew-stable
author Patrick Mezard <pmezard@gmail.com>
date Sun, 03 Jan 2010 18:16:42 +0100
parents 3373ecddadba (current diff) d2847c4523e8 (diff)
children 3ca8f2ae5fee
files
diffstat 1 files changed, 5 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/hgweb/wsgicgi.py	Sat Jan 02 18:14:45 2010 +0100
+++ b/mercurial/hgweb/wsgicgi.py	Sun Jan 03 18:16:42 2010 +0100
@@ -17,8 +17,11 @@
 
     environ = dict(os.environ.iteritems())
     environ.setdefault('PATH_INFO', '')
-    if '.cgi' in environ['PATH_INFO']:
-        environ['PATH_INFO'] = environ['PATH_INFO'].split('.cgi', 1)[1]
+    if environ.get('SERVER_SOFTWARE', '').startswith('Microsoft-IIS'):
+        # IIS includes script_name in path_info
+        scriptname = environ['SCRIPT_NAME']
+        if environ['PATH_INFO'].startswith(scriptname):
+            environ['PATH_INFO'] = environ['PATH_INFO'][len(scriptname):]
 
     environ['wsgi.input'] = sys.stdin
     environ['wsgi.errors'] = sys.stderr