hgweb: strip trailing '/' in apppath before appending '/static/' (issue5943) stable
authorCédric Krier <ced@b2ck.com>
Wed, 25 Jul 2018 10:05:24 +0200
branchstable
changeset 38745 258d90f69076
parent 38744 ae17555ef93f
child 38746 0f948d821fe7
hgweb: strip trailing '/' in apppath before appending '/static/' (issue5943) Differential Revision: https://phab.mercurial-scm.org/D3978
mercurial/hgweb/hgweb_mod.py
mercurial/hgweb/hgwebdir_mod.py
--- a/mercurial/hgweb/hgweb_mod.py	Fri Jul 20 09:08:20 2018 +0200
+++ b/mercurial/hgweb/hgweb_mod.py	Wed Jul 25 10:05:24 2018 +0200
@@ -136,7 +136,7 @@
         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 += '/'
 
--- a/mercurial/hgweb/hgwebdir_mod.py	Fri Jul 20 09:08:20 2018 +0200
+++ b/mercurial/hgweb/hgwebdir_mod.py	Wed Jul 25 10:05:24 2018 +0200
@@ -514,7 +514,7 @@
         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 += '/'