# HG changeset patch # User Cédric Krier # Date 2018-07-25 08:05:24 # Node ID 258d90f69076ba7cdc6fb8d3096674a2291a319e # Parent ae17555ef93fc95d800b46ccab865ea93f9951ca hgweb: strip trailing '/' in apppath before appending '/static/' (issue5943) Differential Revision: https://phab.mercurial-scm.org/D3978 diff --git a/mercurial/hgweb/hgweb_mod.py b/mercurial/hgweb/hgweb_mod.py --- a/mercurial/hgweb/hgweb_mod.py +++ b/mercurial/hgweb/hgweb_mod.py @@ -136,7 +136,7 @@ class requestcontext(object): logourl = self.config('web', 'logourl') logoimg = self.config('web', 'logoimg') staticurl = (self.config('web', 'staticurl') - or req.apppath + '/static/') + or req.apppath.rstrip('/') + '/static/') if not staticurl.endswith('/'): staticurl += '/' 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 @@ -514,7 +514,7 @@ class hgwebdir(object): logourl = config('web', 'logourl') logoimg = config('web', 'logoimg') staticurl = (config('web', 'staticurl') - or req.apppath + '/static/') + or req.apppath.rstrip('/') + '/static/') if not staticurl.endswith('/'): staticurl += '/'