Default mimetype for served files

master
pictuga 2020-08-28 20:52:43 +02:00
parent f6d641eeef
commit 679f406a12
1 changed files with 1 additions and 1 deletions

View File

@ -180,7 +180,7 @@ def cgi_file_handler(environ, start_response, app):
# file successfully open
headers = {}
headers['status'] = '200 OK'
headers['content-type'] = mimetypes.guess_type(path)[0]
headers['content-type'] = mimetypes.guess_type(path)[0] or 'application/octet-stream'
start_response(headers['status'], list(headers.items()))
return wsgiref.util.FileWrapper(f)