Skip to content

Commit

Permalink
[fix] content-typeの送出時のエラーを修正
Browse files Browse the repository at this point in the history
  • Loading branch information
木瓜丸 committed Oct 5, 2020
1 parent feb2595 commit 607cec1
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions mitama/app/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,11 +85,9 @@ def handle(self, req: Request):
for path in self.paths:
filename = path / req.params['path']
if filename.is_file():
mime = guess_type(str(filename)) or 'application/octet-stream'
mime = guess_type(str(filename)) or ('application/octet-stream', )
with open(filename, 'rb') as f:
return Response(body = f.read(), headers={
'content-type': mime[0]
})
return Response(body = f.read(), content_type = mime[0])
for path in self.paths:
filename = path / '404.html'
if filename.is_file():
Expand Down

0 comments on commit 607cec1

Please sign in to comment.