diff --git a/src/http/mime.c b/src/http/mime.c index daca0dd..4a41769 100644 --- a/src/http/mime.c +++ b/src/http/mime.c @@ -5,11 +5,9 @@ #include "http/request.h" -static mimetype mimetypes[] = {{"html", "text/html"}, - {"css", "text/css"}, - {"js", "application/javascript"}, - {"jpg", "image/jpeg"}, - {"png", "image/png"}}; +static mimetype mimetypes[] = { + {"html", "text/html"}, {"css", "text/css"}, {"js", "application/javascript"}, + {"jpg", "image/jpeg"}, {"png", "image/png"}, {"ico", "image/x-icon"}}; int http_get_content_type(char *location_path, char *content_type) { /* 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; }