From b359f71511a818536388e75470215fa3dda8fe67 Mon Sep 17 00:00:00 2001 From: Federico Di Pierro Date: Fri, 19 Nov 2021 17:19:45 +0100 Subject: [PATCH] fix(userspace/falco): accept 'Content-Type' header that contains "application/json", but it is not strictly equal to it. Signed-off-by: Federico Di Pierro --- userspace/falco/webserver.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/userspace/falco/webserver.cpp b/userspace/falco/webserver.cpp index 6098063e..5af8db84 100644 --- a/userspace/falco/webserver.cpp +++ b/userspace/falco/webserver.cpp @@ -150,7 +150,7 @@ bool k8s_audit_handler::handlePost(CivetServer *server, struct mg_connection *co // Ensure that the content-type is application/json const char *ct = server->getHeader(conn, string("Content-Type")); - if(ct == NULL || string(ct) != "application/json") + if(ct == NULL || strstr(ct, "application/json") == NULL) { mg_send_http_error(conn, 400, "Wrong Content Type");