mirror of
https://github.com/getpelican/pelican.git
synced 2025-10-15 20:28:56 +02:00
server: return proper MIME-types for webfonts
This commit is contained in:
parent
31b282f3e2
commit
5803052bb7
1 changed files with 15 additions and 0 deletions
|
|
@ -43,6 +43,21 @@ def parse_arguments():
|
||||||
class ComplexHTTPRequestHandler(server.SimpleHTTPRequestHandler):
|
class ComplexHTTPRequestHandler(server.SimpleHTTPRequestHandler):
|
||||||
SUFFIXES = ['.html', '/index.html', '/', '']
|
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",
|
||||||
|
}
|
||||||
|
|
||||||
def translate_path(self, path):
|
def translate_path(self, path):
|
||||||
# abandon query parameters
|
# abandon query parameters
|
||||||
path = path.split('?', 1)[0]
|
path = path.split('?', 1)[0]
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue