From 7075137b2d438d6c19096ce0b2659762f7a949c1 Mon Sep 17 00:00:00 2001 From: Leonardo Alminana Date: Sat, 24 Aug 2024 03:30:35 +0200 Subject: [PATCH] in_http: fixed http constants Signed-off-by: Leonardo Alminana --- plugins/in_http/http.c | 4 ++-- plugins/in_http/http_prot.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/plugins/in_http/http.c b/plugins/in_http/http.c index 2aa777cc490..bba621475c7 100644 --- a/plugins/in_http/http.c +++ b/plugins/in_http/http.c @@ -94,8 +94,8 @@ static int in_http_init(struct flb_input_instance *ins, port = (unsigned short int) strtoul(ctx->tcp_port, NULL, 10); if (ctx->enable_http2) { - ret = flb_http_server_init(&ctx->http_server, - HTTP_PROTOCOL_AUTODETECT, + ret = flb_http_server_init(&ctx->http_server, + HTTP_PROTOCOL_VERSION_AUTODETECT, (FLB_HTTP_SERVER_FLAG_KEEPALIVE | FLB_HTTP_SERVER_FLAG_AUTO_INFLATE), NULL, ins->host.listen, diff --git a/plugins/in_http/http_prot.c b/plugins/in_http/http_prot.c index e5a3b6bee99..19e5cf7ba8d 100644 --- a/plugins/in_http/http_prot.c +++ b/plugins/in_http/http_prot.c @@ -524,7 +524,7 @@ static int process_payload(struct flb_http *ctx, struct http_conn *conn, } if ((header->val.len == 16 && strncasecmp(header->val.data, "application/json", 16) == 0) || - (header->val.len > 16 && (strncasecmp(header->val.data, "application/json ", 17) == 0) || + (header->val.len > 16 && (strncasecmp(header->val.data, "application/json ", 17) == 0) || strncasecmp(header->val.data, "application/json;", 17) == 0)) { type = HTTP_CONTENT_JSON; } @@ -982,7 +982,7 @@ int http_prot_handle_ng(struct flb_http_request *request, /* ToDo: Fix me */ /* HTTP/1.1 needs Host header */ - if (request->protocol_version == HTTP_PROTOCOL_HTTP1 && + if (request->protocol_version == HTTP_PROTOCOL_VERSION_11 && request->host == NULL) { flb_sds_destroy(tag);