From cd659c5204a98b2e1d8b615649e8dfb025f4bb39 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jos=C3=A9=20Lecaros?= <lecaros@calyptia.com>
Date: Tue, 27 Aug 2024 11:01:55 -0400
Subject: [PATCH] in_elasticsearch: Fix string in http response code 400
 (#8977)

* in_elasticsearch: Fix string in http response code 400.

Signed-off-by: lecaros <lecaros@calyptia.com>
---
 plugins/in_elasticsearch/in_elasticsearch_bulk_prot.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/plugins/in_elasticsearch/in_elasticsearch_bulk_prot.c b/plugins/in_elasticsearch/in_elasticsearch_bulk_prot.c
index 0f452a26da8..5201026ccff 100644
--- a/plugins/in_elasticsearch/in_elasticsearch_bulk_prot.c
+++ b/plugins/in_elasticsearch/in_elasticsearch_bulk_prot.c
@@ -224,7 +224,7 @@ static int send_response(struct in_elasticsearch_bulk_conn *conn, int http_statu
     }
     else if (http_status == 400) {
         flb_sds_printf(&out,
-                       "HTTP/1.1 400 Forbidden\r\n"
+                       "HTTP/1.1 400 Bad Request\r\n"
                        "Server: Fluent Bit v%s\r\n"
                        "Content-Length: %i\r\n\r\n%s",
                        FLB_VERSION_STR,
@@ -942,7 +942,7 @@ static int send_response_ng(struct flb_http_response *response,
         flb_http_response_set_message(response, "No Content");
     }
     else if (http_status == 400) {
-        flb_http_response_set_message(response, "Forbidden");
+        flb_http_response_set_message(response, "Bad Request");
     }
 
     if (content_type != NULL) {