From 98372c9869146ad00b8f37ef5775561536c81b3b Mon Sep 17 00:00:00 2001 From: MinchinWeb Date: Thu, 7 Oct 2021 14:16:27 -0600 Subject: [PATCH] server: for extension_map, refer to upstream version rather than only overwriting it --- pelican/server.py | 23 ++++++++++------------- 1 file changed, 10 insertions(+), 13 deletions(-) diff --git a/pelican/server.py b/pelican/server.py index 7a183bce..913c3761 100644 --- a/pelican/server.py +++ b/pelican/server.py @@ -43,19 +43,16 @@ def parse_arguments(): class ComplexHTTPRequestHandler(server.SimpleHTTPRequestHandler): SUFFIXES = ['.html', '/index.html', '/', ''] - extensions_map = _encodings_map_default = { - # included in Python default implementation - '.gz': 'application/gzip', - '.Z': 'application/octet-stream', - '.bz2': 'application/x-bzip2', - '.xz': 'application/x-xz', - - # web fonts - ".oft": "font/oft", - ".sfnt": "font/sfnt", - ".ttf": "font/ttf", - ".woff": "font/woff", - ".woff2": "font/woff2", + extensions_map = { + **server.SimpleHTTPRequestHandler.extensions_map, + ** { + # web fonts + ".oft": "font/oft", + ".sfnt": "font/sfnt", + ".ttf": "font/ttf", + ".woff": "font/woff", + ".woff2": "font/woff2", + }, } def translate_path(self, path):