From 679f406a12c3efa32403669a5063087e17c19a90 Mon Sep 17 00:00:00 2001 From: pictuga Date: Fri, 28 Aug 2020 20:52:43 +0200 Subject: [PATCH] Default mimetype for served files --- morss/wsgi.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/morss/wsgi.py b/morss/wsgi.py index d68c522..1bfa471 100644 --- a/morss/wsgi.py +++ b/morss/wsgi.py @@ -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)