mercurial/hgweb/hgwebdir_mod.py
changeset 15002 b55c1c6a793e
parent 14913 44382887d012
parent 15001 dd74cd1e5d49
child 15003 a31b8e03af28
--- a/mercurial/hgweb/hgwebdir_mod.py	Mon Aug 01 10:54:34 2011 -0500
+++ b/mercurial/hgweb/hgwebdir_mod.py	Mon Aug 01 14:52:11 2011 -0500
@@ -370,4 +370,7 @@
             env['SERVER_NAME'] = u.host
             if u.port:
                 env['SERVER_PORT'] = u.port
-            env['SCRIPT_NAME'] = '/' + u.path
+            path = u.path or ""
+            if not path.startswith('/'):
+                path = '/' + path
+            env['SCRIPT_NAME'] = path