From d2f7a4e210167a77298aaed2df0461ab2b89fe3d Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Tue, 26 May 2020 22:52:36 +0100 Subject: [PATCH] Font mime types according to mozilla documentation --- content.py | 8 ++++---- daemon.py | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/content.py b/content.py index a1073d028..5237b235f 100644 --- a/content.py +++ b/content.py @@ -681,10 +681,10 @@ def saveFontInFormPOST(fontBytes, debug: bool, # directly search the binary array for the beginning # of a font file extensionList = { - 'wOFF': 'application/font-woff', - 'wOF2': 'application/font-woff2', - 'ttf': 'application/x-font-truetype', - 'OTTO': 'application/x-font-opentype' + 'wOFF': 'font/woff', + 'wOF2': 'font/woff2', + 'ttf': 'font/ttf', + 'OTTO': 'font/otf' } detectedExtension = None for extension, contentType in extensionList.items(): diff --git a/daemon.py b/daemon.py index daba5e1f4..4ba589e3c 100644 --- a/daemon.py +++ b/daemon.py @@ -1112,13 +1112,13 @@ class PubServer(BaseHTTPRequestHandler): fontStr.endswith('.woff') or \ fontStr.endswith('.woff2'): if fontStr.endswith('.otf'): - fontType = 'application/x-font-opentype' + fontType = 'font/otf' elif fontStr.endswith('.ttf'): - fontType = 'application/x-font-truetype' + fontType = 'font/ttf' elif fontStr.endswith('.woff'): - fontType = 'application/font-woff' + fontType = 'font/woff' else: - fontType = 'application/font-woff2' + fontType = 'font/woff2' fontFilename = \ self.server.baseDir + '/fonts/' + fontStr if self._etag_exists(fontFilename):