Compare commits

...

2 Commits

Author SHA1 Message Date
f9dac80905 Fix file download in mongoose 7.x 2021-06-09 13:34:38 -04:00
f8d9b718c0 Fix memory leak in RAW parsing 2021-06-09 08:22:31 -04:00
2 changed files with 5 additions and 5 deletions

View File

@ -95,7 +95,7 @@ void stats_files(struct mg_connection *nc, struct mg_http_message *hm) {
}
char disposition[8192];
snprintf(disposition, sizeof(disposition), "Content-Disposition: inline; filename=\"%s\"", file);
snprintf(disposition, sizeof(disposition), "Content-Disposition: inline; filename=\"%s\"\r\n", file);
char full_path[PATH_MAX];
strcpy(full_path, index->path);
@ -245,10 +245,10 @@ void serve_file_from_disk(cJSON *json, index_t *idx, struct mg_connection *nc, s
LOG_DEBUGF("serve.c", "Serving file from disk: %s", full_path)
char disposition[8192];
snprintf(disposition, sizeof(disposition), "Content-Disposition: inline; filename=\"%s%s%s\"",
snprintf(disposition, sizeof(disposition), "Content-Disposition: inline; filename=\"%s%s%s\"\r\n",
name, strlen(ext) == 0 ? "" : ".", ext);
mg_http_serve_file(nc, hm, full_path, mime, "");
mg_http_serve_file(nc, hm, full_path, mime, disposition);
}
void index_info(struct mg_connection *nc) {
@ -571,7 +571,7 @@ static void ev_router(struct mg_connection *nc, int ev, void *ev_data, UNUSED(vo
file(nc, hm);
} else if (mg_http_match_uri(hm, "/t/*/*")) {
thumbnail(nc, hm);
} else if (mg_http_match_uri(hm, "/s/*")) {
} else if (mg_http_match_uri(hm, "/s/*/*")) {
stats_files(nc, hm);
} else if (mg_http_match_uri(hm, "/tag/*")) {
if (WebCtx.tag_auth_enabled == TRUE && !validate_auth(nc, hm)) {

2
third-party/libscan vendored

@ -1 +1 @@
Subproject commit ee9c98b488ab21ecb1a6e9e10dbbd16054865b58
Subproject commit 58c0758301e360b8c754664fd74d6333d2c51107