From afa210db4f9756b510ef381dd1c8f8063149ba83 Mon Sep 17 00:00:00 2001 From: Michael Lazar Date: Fri, 17 Jul 2020 00:01:51 -0400 Subject: [PATCH] Fix mimetypes not loading the database from the filesystem. #38 --- jetforce/app/static.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/jetforce/app/static.py b/jetforce/app/static.py index 3d3a980..5043e5d 100644 --- a/jetforce/app/static.py +++ b/jetforce/app/static.py @@ -42,6 +42,12 @@ class StaticDirectoryApplication(JetforceApplication): self.index_file = index_file self.mimetypes = mimetypes.MimeTypes() + # We need to manually load all of the operating system mimetype files + # https://bugs.python.org/issue38656 + for fn in mimetypes.knownfiles: + if os.path.isfile(fn): + self.mimetypes.read(fn) + self.mimetypes.add_type("text/gemini", ".gmi") self.mimetypes.add_type("text/gemini", ".gemini")