D3978: hgweb: strip trailing '/' in apppath before appending '/static/'

ced (Cédric Krier) phabricator at mercurial-scm.org
Wed Jul 25 08:27:48 UTC 2018


ced created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REPOSITORY
  rHG Mercurial

REVISION DETAIL
  https://phab.mercurial-scm.org/D3978

AFFECTED FILES
  mercurial/hgweb/hgweb_mod.py
  mercurial/hgweb/hgwebdir_mod.py

CHANGE DETAILS

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 @@
         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 += '/'
 
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 @@
         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 += '/'
 



To: ced, #hg-reviewers
Cc: mercurial-devel


More information about the Mercurial-devel mailing list