Font mime types according to mozilla documentation

main
Bob Mottram 2020-05-26 22:52:36 +01:00
parent b6dc900305
commit d2f7a4e210
2 changed files with 8 additions and 8 deletions

View File

@ -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():

View File

@ -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):