feat(mime): add favicon mimetype
This commit is contained in:
@@ -5,11 +5,9 @@
|
|||||||
|
|
||||||
#include "http/request.h"
|
#include "http/request.h"
|
||||||
|
|
||||||
static mimetype mimetypes[] = {{"html", "text/html"},
|
static mimetype mimetypes[] = {
|
||||||
{"css", "text/css"},
|
{"html", "text/html"}, {"css", "text/css"}, {"js", "application/javascript"},
|
||||||
{"js", "application/javascript"},
|
{"jpg", "image/jpeg"}, {"png", "image/png"}, {"ico", "image/x-icon"}};
|
||||||
{"jpg", "image/jpeg"},
|
|
||||||
{"png", "image/png"}};
|
|
||||||
|
|
||||||
int http_get_content_type(char *location_path, char *content_type) {
|
int http_get_content_type(char *location_path, char *content_type) {
|
||||||
/* Find last occurrence of a string */
|
/* Find last occurrence of a string */
|
||||||
@@ -25,5 +23,7 @@ int http_get_content_type(char *location_path, char *content_type) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
snprintf(content_type, CWS_HTTP_CONTENT_TYPE - 1, "%s", "Content-Type not supported");
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user