mirror of
https://github.com/simon987/sist2.git
synced 2025-04-21 19:26:45 +00:00
Compare commits
5 Commits
f984baf7fd
...
5a1a04629f
Author | SHA1 | Date | |
---|---|---|---|
5a1a04629f | |||
242dd67416 | |||
54d902146a | |||
3b0ab3679a | |||
|
58ce0ef414 |
@ -531,8 +531,8 @@ class Sist2Api {
|
|||||||
size: 0
|
size: 0
|
||||||
}).then(res => {
|
}).then(res => {
|
||||||
const range = {
|
const range = {
|
||||||
min: res.aggregations.dateMin.value,
|
min: res.aggregations.dateMin.value / 1000,
|
||||||
max: res.aggregations.dateMax.value,
|
max: res.aggregations.dateMax.value / 1000,
|
||||||
}
|
}
|
||||||
|
|
||||||
if (range.min == null) {
|
if (range.min == null) {
|
||||||
|
@ -248,9 +248,11 @@ void serve_file_from_disk(cJSON *json, index_t *idx, struct mg_connection *nc, s
|
|||||||
|
|
||||||
char mime_mapping[8192];
|
char mime_mapping[8192];
|
||||||
if (strlen(ext) == 0) {
|
if (strlen(ext) == 0) {
|
||||||
snprintf(mime_mapping, sizeof(mime_mapping), "%s=%s", full_path, mime);
|
snprintf(mime_mapping, sizeof(mime_mapping), "%s=%s%s",
|
||||||
|
full_path, mime, STR_STARTS_WITH_CONSTANT(mime, "text/") ? "; charset=utf8" : "");
|
||||||
} else {
|
} else {
|
||||||
snprintf(mime_mapping, sizeof(mime_mapping), "%s=%s", ext, mime);
|
snprintf(mime_mapping, sizeof(mime_mapping), "%s=%s%s",
|
||||||
|
ext, mime, STR_STARTS_WITH_CONSTANT(mime, "text/") ? "; charset=utf8" : "");
|
||||||
}
|
}
|
||||||
|
|
||||||
struct mg_http_serve_opts opts = {
|
struct mg_http_serve_opts opts = {
|
||||||
@ -526,9 +528,9 @@ void tag(struct mg_connection *nc, struct mg_http_message *hm) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
tag_req_t *req = parse_tag_request(json);
|
tag_req_t *req = parse_tag_request(json);
|
||||||
cJSON_Delete(json);
|
|
||||||
if (req == NULL) {
|
if (req == NULL) {
|
||||||
LOG_DEBUGF("serve.c", "Could not parse tag request", arg_index);
|
LOG_DEBUGF("serve.c", "Could not parse tag request", arg_index);
|
||||||
|
cJSON_Delete(json);
|
||||||
HTTP_REPLY_BAD_REQUEST
|
HTTP_REPLY_BAD_REQUEST
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -552,6 +554,7 @@ void tag(struct mg_connection *nc, struct mg_http_message *hm) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
free(req);
|
free(req);
|
||||||
|
cJSON_Delete(json);
|
||||||
}
|
}
|
||||||
|
|
||||||
int validate_auth(struct mg_connection *nc, struct mg_http_message *hm) {
|
int validate_auth(struct mg_connection *nc, struct mg_http_message *hm) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user