Support /static/ files serving, Ref: #1362

This commit is contained in:
ziajka committed 2018-06-22 15:29:47 +02:00
1 parent 96d5e351f7
commit 867e997b74
10 files changed
+151 -4

No files matched your search

+3
View File
@@ -117,6 +117,9 @@ class Response(aiohttp.web.Response):
"""
Return a file as a response
"""
if not os.path.exists(path):
raise aiohttp.web.HTTPNotFound()
ct, encoding = mimetypes.guess_type(path)
if not ct:
ct = 'application/octet-stream'