From c1a3b36910068e6fac14a50593784f3e83842689 Mon Sep 17 00:00:00 2001 From: metalfork Date: Fri, 28 Jun 2024 10:46:17 -0400 Subject: [PATCH] Updated application/json Content-Type header detect to allow detecting application/json when length is longer than 16 character because of addition encoding in the header value, aka 'Content-type: application/json; charset=utf-8' --- plugins/in_http/http_prot.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/in_http/http_prot.c b/plugins/in_http/http_prot.c index 188591e4d0d..cbf31f6efe7 100644 --- a/plugins/in_http/http_prot.c +++ b/plugins/in_http/http_prot.c @@ -523,7 +523,7 @@ static int process_payload(struct flb_http *ctx, struct http_conn *conn, return -1; } - if (header->val.len == 16 && + if (header->val.len >= 16 && strncasecmp(header->val.data, "application/json", 16) == 0) { type = HTTP_CONTENT_JSON; }