浏览代码

Merge pull request #25 from lizhirui/master

fixed default mimetype,add "json" minetype
aozima 4 年之前
父节点
当前提交
5491546f9f
共有 1 个文件被更改,包括 3 次插入1 次删除
  1. 3 1
      src/wn_mimetype.c

+ 3 - 1
src/wn_mimetype.c

@@ -19,6 +19,7 @@
  * Change Logs:
  * Date           Author       Notes
  * 2011-08-02     Bernard      the first version
+ * 2021-02-18     lizhirui     fixed default mimetype,add json minetype
  */
 
 #include <string.h>
@@ -54,6 +55,7 @@ static const struct webnet_mime_entry mime_tables[] =
     { "tar",	"application/x-tar" },
     { "zip",	"application/zip" },
     { "xml",	"text/xml" },
+    { "json",	"application/json" },
     { RT_NULL,  RT_NULL }
 };
 
@@ -81,5 +83,5 @@ const char* mime_get_type(const char* url)
     }
 
     /* return text/html as default */
-    return mime_tables[0].type;
+    return mime_tables[1].type;
 }