mirror of
https://github.com/simon987/sist2.git
synced 2025-04-19 10:16:42 +00:00
Fix #112
This commit is contained in:
parent
d3bd53a5ea
commit
ae283f77ad
@ -535,8 +535,8 @@ void tag(struct mg_connection *nc, struct http_message *hm, struct mg_str *path)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
char buf[8192];
|
char *buf = malloc(sizeof(char) * 8192);
|
||||||
snprintf(buf, sizeof(buf),
|
snprintf(buf, 8192,
|
||||||
"{"
|
"{"
|
||||||
" \"script\" : {"
|
" \"script\" : {"
|
||||||
" \"source\": \"if (ctx._source.tag.contains(params.tag)) { ctx._source.tag.remove(ctx._source.tag.indexOf(params.tag)) }\","
|
" \"source\": \"if (ctx._source.tag.contains(params.tag)) { ctx._source.tag.remove(ctx._source.tag.indexOf(params.tag)) }\","
|
||||||
@ -555,8 +555,8 @@ void tag(struct mg_connection *nc, struct http_message *hm, struct mg_str *path)
|
|||||||
} else {
|
} else {
|
||||||
cJSON_AddItemToArray(arr, cJSON_CreateString(arg_req->name));
|
cJSON_AddItemToArray(arr, cJSON_CreateString(arg_req->name));
|
||||||
|
|
||||||
char buf[8192];
|
char *buf = malloc(sizeof(char) * 8192);
|
||||||
snprintf(buf, sizeof(buf),
|
snprintf(buf, 8192,
|
||||||
"{"
|
"{"
|
||||||
" \"script\" : {"
|
" \"script\" : {"
|
||||||
" \"source\": \"if(ctx._source.tag == null) {ctx._source.tag = new ArrayList()} ctx._source.tag.add(params.tag)\","
|
" \"source\": \"if(ctx._source.tag == null) {ctx._source.tag = new ArrayList()} ctx._source.tag.add(params.tag)\","
|
||||||
|
Loading…
x
Reference in New Issue
Block a user