server: for extension_map, refer to upstream version rather than only overwriting it

This commit is contained in:
MinchinWeb 2021-10-07 14:16:27 -06:00
commit 98372c9869

View file

@ -43,19 +43,16 @@ def parse_arguments():
class ComplexHTTPRequestHandler(server.SimpleHTTPRequestHandler): class ComplexHTTPRequestHandler(server.SimpleHTTPRequestHandler):
SUFFIXES = ['.html', '/index.html', '/', ''] SUFFIXES = ['.html', '/index.html', '/', '']
extensions_map = _encodings_map_default = { extensions_map = {
# included in Python default implementation **server.SimpleHTTPRequestHandler.extensions_map,
'.gz': 'application/gzip', ** {
'.Z': 'application/octet-stream',
'.bz2': 'application/x-bzip2',
'.xz': 'application/x-xz',
# web fonts # web fonts
".oft": "font/oft", ".oft": "font/oft",
".sfnt": "font/sfnt", ".sfnt": "font/sfnt",
".ttf": "font/ttf", ".ttf": "font/ttf",
".woff": "font/woff", ".woff": "font/woff",
".woff2": "font/woff2", ".woff2": "font/woff2",
},
} }
def translate_path(self, path): def translate_path(self, path):