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

login
register
mail settings
Submitter phabricator
Date July 25, 2018, 12:50 p.m.
Message ID <41e1e67c6b38e17a3bbfdb54f0401e3e@localhost.localdomain>
Download mbox | patch
Permalink /patch/32943/
State Not Applicable
Headers show

Comments

phabricator - July 25, 2018, 12:50 p.m.
This revision was automatically updated to reflect the committed changes.
Closed by commit rHG258d90f69076: hgweb: strip trailing &#039;/&#039; in apppath before appending &#039;/static/&#039; (issue5943) (authored by ced, committed by ).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D3978?vs=9659&id=9665

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

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

CHANGE DETAILS




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

Patch

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