mirror of
https://github.com/warmcat/libwebsockets.git
synced 2025-03-30 00:00:16 +01:00
mimetypes add additional canned
Signed-off-by: Andy Green <andy@warmcat.com>
This commit is contained in:
parent
a709cbb2f5
commit
f4767497d3
2 changed files with 33 additions and 0 deletions
18
changelog
18
changelog
|
@ -10,6 +10,24 @@ Fixes
|
||||||
|
|
||||||
3) Some fixes for WinCE build
|
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
|
v2.0.0
|
||||||
======
|
======
|
||||||
|
|
15
lib/server.c
15
lib/server.c
|
@ -214,15 +214,30 @@ static const char * get_mimetype(const char *file)
|
||||||
if (!strcmp(&file[n - 4], ".jpg"))
|
if (!strcmp(&file[n - 4], ".jpg"))
|
||||||
return "image/jpeg";
|
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"))
|
if (!strcmp(&file[n - 5], ".html"))
|
||||||
return "text/html";
|
return "text/html";
|
||||||
|
|
||||||
if (!strcmp(&file[n - 4], ".css"))
|
if (!strcmp(&file[n - 4], ".css"))
|
||||||
return "text/css";
|
return "text/css";
|
||||||
|
|
||||||
|
if (!strcmp(&file[n - 4], ".txt"))
|
||||||
|
return "text/plain";
|
||||||
|
|
||||||
if (!strcmp(&file[n - 4], ".ttf"))
|
if (!strcmp(&file[n - 4], ".ttf"))
|
||||||
return "application/x-font-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;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue