Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 12 additions & 4 deletions images.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,18 @@ def addURIPrefix(text, mimeType):
elif mimeType == 'svg':
mimeType += "+xml"
mimeType = "image/" + mimeType
elif mimeType in 'woff|woff2':
mimeType = "application/font-" + mimeType
elif mimeType in 'ttf|otf':
mimeType = "application/font-sfnt"
elif mimeType in 'otf|ttf|woff|woff2':
# (ca. 2017) The IANA deprecated the various font subtypes of the
# "application" type in favor of the new "font" type. While the
# standards were new at that point, many browsers had long accepted
# such media types due to existing use in the wild�erroneous at
# that point or not�so they're safe to use even considering older
# browsers.
# otf : application/font-sfnt -> font/otf
# ttf : application/font-sfnt -> font/ttf
# woff : application/font-woff -> font/woff
# woff2 : application/font-woff2 -> font/woff2
mimeType = "font/" + mimeType
else:
mimeType = "application/octet-stream"

Expand Down