Content type.
This commit is contained in:
parent
be8519d8b7
commit
66147497a8
@ -61,7 +61,7 @@ class TemplateView(BaseView):
|
||||
renderer = MarkdownRenderer(self.request.app, path)
|
||||
response = web.Response(text=renderer.render())
|
||||
else:
|
||||
reponse = await super().render_template(path, self.request, context)
|
||||
response = await super().render_template(path, self.request, context)
|
||||
|
||||
response.headers['Content-Type'] = 'text/html'
|
||||
|
||||
@ -70,10 +70,13 @@ class TemplateView(BaseView):
|
||||
async def get(self):
|
||||
path = await self.resolve_template(self.request.match_info['tail'])
|
||||
if path:
|
||||
print("Found path", path)
|
||||
return await self.render_template(path)
|
||||
path = pathlib.Path(self.request.app.template_path).joinpath(self.request.match_info['tail'].lstrip('/'))
|
||||
if path.exists():
|
||||
print("Found non template path", path)
|
||||
return web.Response(body=path.read_bytes())
|
||||
print("Path not found", path)
|
||||
return web.Response(status=404)
|
||||
|
||||
async def post(self):
|
||||
|
Loading…
Reference in New Issue
Block a user