Fixed the data endpoint to prioritize chart over context if both are present (#10032)
Stelios Fragkakis committed
Oct 6, 2020 at 12:58 UTC
ce79c3d7a8f2c7a1cd9d853d1397023e745e03ed
1 file changed
+2
-2
web/api/web_api_v1.c
+2
-2
@@ -492,7 +492,7 @@ inline int web_client_api_request_v1_data(RRDHOST *host, struct web_client *w, c
492
}
493
494
struct context_param *context_param_list = NULL;
495
- if (context) {
495
+ if (context && !chart) {
496
RRDSET *st1;
497
uint32_t context_hash = simple_hash(context);
498
rrdhost_rdlock(localhost);
@@ -513,7 +513,7 @@ inline int web_client_api_request_v1_data(RRDHOST *host, struct web_client *w, c
513
}
514
515
if (!st && !context_param_list) {
516
- if (context) {
516
+ if (context && !chart) {
517
buffer_strcat(w->response.data, "Context is not found: ");
518
buffer_strcat_htmlescape(w->response.data, context);
519
}