Skip to content

Commit

Permalink
in_http: fixed http constants
Browse files Browse the repository at this point in the history
Signed-off-by: Leonardo Alminana <[email protected]>
  • Loading branch information
leonardo-albertovich committed Aug 24, 2024
1 parent 3df1a9d commit 7075137
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions plugins/in_http/http.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
4 changes: 2 additions & 2 deletions plugins/in_http/http_prot.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down Expand Up @@ -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);

Expand Down

0 comments on commit 7075137

Please sign in to comment.