[pve-devel] [PATCH pve-manager 1/3] Add mime type for woff2 fonts, also update mime type for ttf fonts

Emmanuel Kasper e.kasper at proxmox.com
Thu Nov 12 13:15:26 CET 2015


application/font-woff2 is still in discussion but works in main three browsers
This is needed for ExtJS6, which includes some woff2 fonts

ttf font mime type is taken from the official IANA assignment, and works as
well in main three browsers
---
 PVE/HTTPServer.pm | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/PVE/HTTPServer.pm b/PVE/HTTPServer.pm
index 927abc0..d446260 100755
--- a/PVE/HTTPServer.pm
+++ b/PVE/HTTPServer.pm
@@ -364,8 +364,11 @@ sub send_file_start {
 	    } elsif ($filename =~ m/\.woff$/) {
 		$ct = 'application/font-woff';
 		$nocomp = 1;
+	    } elsif ($filename =~ m/\.woff2$/) {
+		$ct = 'application/font-woff2';
+		$nocomp = 1;
 	    } elsif ($filename =~ m/\.ttf$/) {
-		$ct = 'application/x-font-ttf';
+		$ct = 'application/font-snft';
 		$nocomp = 1;
 	    } else {
 		die "unable to detect content type";
-- 
2.1.4





More information about the pve-devel mailing list