From 026525d584cc7c790965b787e4ebdcce8e3d4f80 Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Wed, 8 Jul 2026 12:12:58 +0200 Subject: [PATCH] match content-type only at beginning of the line --- src/microhttpd/postprocessor.c | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/src/microhttpd/postprocessor.c b/src/microhttpd/postprocessor.c index 6e6bfbd1..d32c5b0f 100644 --- a/src/microhttpd/postprocessor.c +++ b/src/microhttpd/postprocessor.c @@ -595,16 +595,12 @@ try_match_header (const char *prefix, { if (NULL != *suffix) return MHD_NO; - while (0 != *line) + if (MHD_str_equal_caseless_n_ (prefix, + line, + prefix_len)) { - if (MHD_str_equal_caseless_n_ (prefix, - line, - prefix_len)) - { - *suffix = strdup (&line[prefix_len]); - return MHD_YES; - } - ++line; + *suffix = strdup (&line[prefix_len]); + return MHD_YES; } return MHD_NO; }