From a01bc05634a3b4fdb9db4769b5d9adca717fc29d Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Tue, 26 May 2020 16:08:43 +0100 Subject: [PATCH] Handle font extensions --- content.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/content.py b/content.py index 9d61a5f45..a65e4403a 100644 --- a/content.py +++ b/content.py @@ -615,7 +615,11 @@ def saveMediaInFormPOST(mediaBytes, debug: bool, 'mp4': 'video/mp4', 'ogv': 'video/ogv', 'mp3': 'audio/mpeg', - 'ogg': 'audio/ogg' + 'ogg': 'audio/ogg', + 'woff': 'application/font-woff', + 'woff2': 'application/font-woff2', + 'ttf': 'application/x-font-truetype', + 'otf': 'application/x-font-opentype' } detectedExtension = None for extension, contentType in extensionList.items(): @@ -645,7 +649,8 @@ def saveMediaInFormPOST(mediaBytes, debug: bool, break # remove any existing image files with a different format - extensionTypes = ('png', 'jpg', 'jpeg', 'gif', 'webp') + extensionTypes = ('png', 'jpg', 'jpeg', 'gif', 'webp', + 'woff', 'woff2', 'ttf', 'otf') for ex in extensionTypes: if ex == detectedExtension: continue