diff --git a/neomi.py b/neomi.py index c0b5d2c..7d4e23c 100644 --- a/neomi.py +++ b/neomi.py @@ -411,6 +411,7 @@ def read_infofile(file_path): # TODO: Read from file extension_mimetypes = {'.txt': 'text/plain', '.text': 'text/plain', '.log': 'text/plain', '.html': 'text/html'} +itemtype_mimetypes = {'0': 'text/plain', '1': 'text/x-gophermap', 'h': 'text/html'} mimetype_cache = {} mimetype_cache_lock = threading.Lock() @@ -726,7 +727,10 @@ class Serve(threading.Thread): try: full_path = get_full_path(path, config = self.config) - mimetype = get_mimetype(full_path, config = self.config) + if protocol == Protocol.http and itemtype in itemtype_mimetypes: + mimetype = itemtype_mimetypes[itemtype] + else: + mimetype = get_mimetype(full_path, config = self.config) file = get_file(full_path, config = self.config) except FileNotFoundError: