Skip to content

Commit e23e4d9

Browse files
committed
Add font MIME types, fix #1601
As per http://stackoverflow.com/a/10864297
1 parent b265ea0 commit e23e4d9

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

libraries/ESP8266WebServer/src/detail/RequestHandlersImpl.h

+6
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,12 @@ class StaticRequestHandler : public RequestHandler {
123123
else if (path.endsWith(".jpg")) return "image/jpeg";
124124
else if (path.endsWith(".ico")) return "image/x-icon";
125125
else if (path.endsWith(".svg")) return "image/svg+xml";
126+
else if (path.endsWith(".ttf")) return "application/x-font-ttf";
127+
else if (path.endsWith(".otf")) return "application/x-font-opentype";
128+
else if (path.endsWith(".woff")) return "application/font-woff";
129+
else if (path.endsWith(".woff2")) return "application/font-woff2";
130+
else if (path.endsWith(".eot")) return "application/vnd.ms-fontobject";
131+
else if (path.endsWith(".sfnt")) return "application/font-sfnt";
126132
else if (path.endsWith(".xml")) return "text/xml";
127133
else if (path.endsWith(".pdf")) return "application/pdf";
128134
else if (path.endsWith(".zip")) return "application/zip";

0 commit comments

Comments
 (0)