# HG changeset patch # User Gregory Szorc # Date 2018-03-11 17:51:14 # Node ID a5c478843c82afbcd026455b0c3a8638e9146fe7 # Parent ee395147bb28a2b357ca3905f2cc750449aa51f1 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 diff --git a/mercurial/hgweb/hgwebdir_mod.py b/mercurial/hgweb/hgwebdir_mod.py --- a/mercurial/hgweb/hgwebdir_mod.py +++ b/mercurial/hgweb/hgwebdir_mod.py @@ -542,7 +542,8 @@ class hgwebdir(object): 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 += '/'