From dbd4997f03779a6d541cd9298c1667c5701bcd06 Mon Sep 17 00:00:00 2001 From: Stewart Webb Date: Thu, 23 May 2024 08:50:10 +1000 Subject: [PATCH] Update opentelemetry HTTP server to return deserialisation error message in non-ok handling cases Signed-off-by: Stewart Webb --- plugins/in_opentelemetry/opentelemetry_prot.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/plugins/in_opentelemetry/opentelemetry_prot.c b/plugins/in_opentelemetry/opentelemetry_prot.c index 7ea12d939af..3b594bce1e3 100644 --- a/plugins/in_opentelemetry/opentelemetry_prot.c +++ b/plugins/in_opentelemetry/opentelemetry_prot.c @@ -2461,7 +2461,12 @@ int opentelemetry_prot_handle_ng(struct flb_http_request *request, send_export_service_response_ng(response, result, payload_type); } else { - send_response_ng(response, context->successful_response_code, NULL); + if (result == 0) { + send_response_ng(response, context->successful_response_code, NULL); + } + else { + send_response_ng(response, 400, "invalid request: deserialisation error\n"); + } } return result;