mirror of
https://github.com/sist2app/sist2.git
synced 2026-03-29 11:31:35 +00:00
Version bump, fix mime serve for files with no extensions
This commit is contained in:
@@ -49,7 +49,7 @@
|
|||||||
#include <ctype.h>
|
#include <ctype.h>
|
||||||
#include "git_hash.h"
|
#include "git_hash.h"
|
||||||
|
|
||||||
#define VERSION "2.12.1"
|
#define VERSION "2.12.2"
|
||||||
static const char *const Version = VERSION;
|
static const char *const Version = VERSION;
|
||||||
|
|
||||||
#ifndef SIST_PLATFORM
|
#ifndef SIST_PLATFORM
|
||||||
|
|||||||
@@ -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",
|
"Accept-Ranges: bytes\r\nCache-Control: no-store\r\n",
|
||||||
name, strlen(ext) == 0 ? "" : ".", ext);
|
name, strlen(ext) == 0 ? "" : ".", ext);
|
||||||
|
|
||||||
char mime_mapping[1024];
|
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);
|
snprintf(mime_mapping, sizeof(mime_mapping), "%s=%s", ext, mime);
|
||||||
|
}
|
||||||
|
|
||||||
struct mg_http_serve_opts opts = {
|
struct mg_http_serve_opts opts = {
|
||||||
.extra_headers = disposition,
|
.extra_headers = disposition,
|
||||||
|
|||||||
Reference in New Issue
Block a user