diff --git a/src/sist.h b/src/sist.h index 4e7bd11..894f637 100644 --- a/src/sist.h +++ b/src/sist.h @@ -49,7 +49,7 @@ #include #include "git_hash.h" -#define VERSION "2.12.1" +#define VERSION "2.12.2" static const char *const Version = VERSION; #ifndef SIST_PLATFORM diff --git a/src/web/serve.c b/src/web/serve.c index 69d4a01..188c04e 100644 --- a/src/web/serve.c +++ b/src/web/serve.c @@ -285,8 +285,12 @@ void serve_file_from_disk(cJSON *json, index_t *idx, struct mg_connection *nc, s "Accept-Ranges: bytes\r\nCache-Control: no-store\r\n", name, strlen(ext) == 0 ? "" : ".", ext); - char mime_mapping[1024]; - snprintf(mime_mapping, sizeof(mime_mapping), "%s=%s", ext, mime); + char mime_mapping[8192]; + if (strlen(ext) == 0) { + snprintf(mime_mapping, sizeof(mime_mapping), "%s=%s", full_path, mime); + } else { + snprintf(mime_mapping, sizeof(mime_mapping), "%s=%s", ext, mime); + } struct mg_http_serve_opts opts = { .extra_headers = disposition,