changeset 36895:a5c478843c82

hgweb: construct static URL like hgweb does hgwebdir has a bit of code for constructing URLs. This reinvents wheels from our parsedrequest instance. And sometimes the behavior varies from what hgweb does. We'll want to converge that behavior. This commit changes hgwebdir so its staticurl template keyword is constructed the same way as hgweb's. There's probably room to factor this into a shared function. But let's solve the problem of divergence first. Differential Revision: https://phab.mercurial-scm.org/D2817
author Gregory Szorc <gregory.szorc@gmail.com>
date Sun, 11 Mar 2018 10:51:14 -0700
parents ee395147bb28
children b2a3308d6a21
files mercurial/hgweb/hgwebdir_mod.py
diffstat 1 files changed, 2 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/hgweb/hgwebdir_mod.py	Sun Mar 11 10:38:46 2018 -0700
+++ b/mercurial/hgweb/hgwebdir_mod.py	Sun Mar 11 10:51:14 2018 -0700
@@ -542,7 +542,8 @@
         sessionvars = webutil.sessionvars(vars, r'?')
         logourl = config('web', 'logourl')
         logoimg = config('web', 'logoimg')
-        staticurl = config('web', 'staticurl') or url + 'static/'
+        staticurl = (config('web', 'staticurl')
+                     or wsgireq.req.apppath + '/static/')
         if not staticurl.endswith('/'):
             staticurl += '/'