Created attachment 2014 [details] Patch: strip trailling slash With the changeset 0031e972ded2, the staticurl is construct with req.apppath + '/static/'. But req.apppath may already end with '/' so the url gets two '//' which makes it point to the root. I think templater should strip first the trailing '/' in req.apppath before appending '/static/'.
I'm not yet sure how to make apppath to end with a / or if // would break anything, can you provide a test case? .rstrip('/') make sense, but right now we're in code freeze until the next month (when 4.7 is released) and that means only bug fixes for stable are pushed. With a test case this could qualify. Looking at the attached patch, there's also hgwebdir_mod.py that also has the same code, should it also be changed? In general, patches need to go to mercurial-devel mailing list or our phabricator to be reviewed, https://www.mercurial-scm.org/wiki/ContributingChanges
No idea whether apppath is supposed to end with "/". indygreg?
To get apppath ends with a '/' can be obtained with a web.baseurl that ends also with '/'. Here is the patch on phabricator: https://phab.mercurial-scm.org/D3977
Due to a bug in phabricator extension, here is the new link https://phab.mercurial-scm.org/D3978
Fixed by https://mercurial-scm.org/repo/hg/rev/258d90f69076 Cédric Krier <ced@b2ck.com> hgweb: strip trailing '/' in apppath before appending '/static/' (issue5943) Differential Revision: https://phab.mercurial-scm.org/D3978 (please test the fix)
Bug was set to TESTING for 7 days, resolving