changeset 36901:006165d4d7e2

hgweb: construct {url} with req.apppath This is how the hgweb WSGI application does it. Let's make the behavior consistent. Differential Revision: https://phab.mercurial-scm.org/D2823
author Gregory Szorc <gregory.szorc@gmail.com>
date Sun, 11 Mar 2018 15:08:36 -0700
parents 219b23359f4c
children e473a032f38a
files mercurial/hgweb/hgwebdir_mod.py
diffstat 1 files changed, 1 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/hgweb/hgwebdir_mod.py	Sun Mar 11 15:33:56 2018 -0700
+++ b/mercurial/hgweb/hgwebdir_mod.py	Sun Mar 11 15:08:36 2018 -0700
@@ -496,10 +496,6 @@
         def config(section, name, default=uimod._unset, untrusted=True):
             return self.ui.config(section, name, default, untrusted)
 
-        url = wsgireq.env.get('SCRIPT_NAME', '')
-        if not url.endswith('/'):
-            url += '/'
-
         vars = {}
         styles, (style, mapfile) = hgweb_mod.getstyle(wsgireq.req, config,
                                                       self.templatepath)
@@ -517,7 +513,7 @@
         defaults = {
             "encoding": encoding.encoding,
             "motd": motd,
-            "url": url,
+            "url": wsgireq.req.apppath + '/',
             "logourl": logourl,
             "logoimg": logoimg,
             "staticurl": staticurl,