mimetypes add additional canned
authorAndy Green <andy@warmcat.com>
Fri, 6 May 2016 00:08:48 +0000 (08:08 +0800)
committerAndy Green <andy@warmcat.com>
Fri, 6 May 2016 00:08:48 +0000 (08:08 +0800)
Signed-off-by: Andy Green <andy@warmcat.com>
changelog
lib/server.c

index be739913da30d6ad29c20d749d9997d51f265da4..0d06acc72d2678aca20180969877b1a2a57ed4ea 100644 (file)
--- a/changelog
+++ b/changelog
@@ -10,6 +10,24 @@ Fixes
 
 3) Some fixes for WinCE build
 
+4) Additional canned mimetypes for mounts, the full list is
+
+       .ico    image/x-icon
+       .gif    image/gif
+       .js     text/javascript
+       .png    image/png
+       .jpg    image/jpeg
+       .gz     application/gzip
+       .JPG    image/jpeg
+       .html   text/html
+       .css    text/css
+       .txt    text/plain
+       .ttf    application/x-font-ttf
+       .woff   application/font-woff
+       .xml    application/xml
+
+
+
 
 v2.0.0
 ======
index 33f6c1832d5985f7ca22dd0e1722c03973df6c77..0e06cfa413c293430732e436b03b119d437561a5 100644 (file)
@@ -214,15 +214,30 @@ static const char * get_mimetype(const char *file)
        if (!strcmp(&file[n - 4], ".jpg"))
                return "image/jpeg";
 
+       if (!strcmp(&file[n - 3], ".gz"))
+               return "application/gzip";
+
+       if (!strcmp(&file[n - 4], ".JPG"))
+               return "image/jpeg";
+
        if (!strcmp(&file[n - 5], ".html"))
                return "text/html";
 
        if (!strcmp(&file[n - 4], ".css"))
                return "text/css";
 
+       if (!strcmp(&file[n - 4], ".txt"))
+               return "text/plain";
+
        if (!strcmp(&file[n - 4], ".ttf"))
                return "application/x-font-ttf";
 
+       if (!strcmp(&file[n - 5], ".woff"))
+               return "application/font-woff";
+
+       if (!strcmp(&file[n - 4], ".xml"))
+               return "application/xml";
+
        return NULL;
 }