summaryrefslogtreecommitdiff
path: root/file.c
diff options
context:
space:
mode:
Diffstat (limited to 'file.c')
-rw-r--r--file.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/file.c b/file.c
index 1c85bdd..b64480c 100644
--- a/file.c
+++ b/file.c
@@ -63,6 +63,8 @@ enum serve_method file_method_for_path(const char *filepath, enum http_res_code
static const char *mime_type_for_path(const char *filepath)
{
const char *ext = strrchr(filepath, '.');
+ if (ext == NULL)
+ return "text/plain";
if (strcmp(ext, ".html") == 0)
return "text/html";
if (strcmp(ext, ".css") == 0)