From: Michael Tremer Date: Thu, 14 Dec 2023 15:25:03 +0000 (+0000) Subject: static: Make file name handling sane X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=930647fcd0736bc53fb2274e3f180403af8cc4d4;p=ipfire.org.git static: Make file name handling sane Signed-off-by: Michael Tremer --- diff --git a/src/web/__init__.py b/src/web/__init__.py index 0531f33e..da7c9092 100644 --- a/src/web/__init__.py +++ b/src/web/__init__.py @@ -153,7 +153,7 @@ class Application(tornado.web.Application): # Downloads (r"/downloads", downloads.IndexHandler), - (r"/downloads/cloud", StaticHandler, { "template" : "../downloads/cloud.html" }), + (r"/downloads/cloud", StaticHandler, { "template" : "downloads/cloud.html" }), (r"/downloads/mirrors", downloads.MirrorsHandler), (r"/downloads/thank-you", downloads.ThankYouHandler), (r"/downloads/([0-9a-z\-\.]+)", downloads.ReleaseHandler), @@ -172,8 +172,8 @@ class Application(tornado.web.Application): # Projects (r"/projects/location", location.IndexHandler), - (r"/projects/location/download", StaticHandler, { "template" : "../location/download.html" }), - (r"/projects/location/how\-to\-use", StaticHandler, { "template" : "../location/how-to-use.html" }), + (r"/projects/location/download", StaticHandler, { "template" : "location/download.html" }), + (r"/projects/location/how\-to\-use", StaticHandler, { "template" : "location/how-to-use.html" }), (r"/projects/location/lookup/(.+)", location.LookupHandler), # Single-Sign-On for Discourse @@ -199,10 +199,10 @@ class Application(tornado.web.Application): (r"/voip", voip.IndexHandler), # Static Pages - (r"/about", StaticHandler, { "template" : "about.html" }), - (r"/legal", StaticHandler, { "template" : "legal.html" }), - (r"/help", StaticHandler, { "template" : "help.html" }), - (r"/sitemap", StaticHandler, { "template" : "sitemap.html" }), + (r"/about", StaticHandler, { "template" : "static/about.html" }), + (r"/legal", StaticHandler, { "template" : "static/legal.html" }), + (r"/help", StaticHandler, { "template" : "static/help.html" }), + (r"/sitemap", StaticHandler, { "template" : "static/sitemap.html" }), # API (r"/api/check/email", auth.APICheckEmail), diff --git a/src/web/handlers.py b/src/web/handlers.py index 1285a5c6..739c4b62 100644 --- a/src/web/handlers.py +++ b/src/web/handlers.py @@ -18,4 +18,4 @@ class StaticHandler(base.BaseHandler): self._template = template def get(self): - self.render("static/%s" % self._template) + self.render("%s" % self._template)