Default mimetype for served files
parent
f6d641eeef
commit
679f406a12
|
@ -180,7 +180,7 @@ def cgi_file_handler(environ, start_response, app):
|
||||||
# file successfully open
|
# file successfully open
|
||||||
headers = {}
|
headers = {}
|
||||||
headers['status'] = '200 OK'
|
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()))
|
start_response(headers['status'], list(headers.items()))
|
||||||
return wsgiref.util.FileWrapper(f)
|
return wsgiref.util.FileWrapper(f)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue