From 469410001bf283b658515391514d4c2077731d04 Mon Sep 17 00:00:00 2001 From: Xavier Del Campo Romero Date: Fri, 27 Feb 2026 11:51:12 +0100 Subject: http.c: Break on found header Once a given HTTP header from the list has been found, it makes no sense to keep reading the rest from it. --- http.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/http.c b/http.c index 2868d07..014dcc6 100644 --- a/http.c +++ b/http.c @@ -1592,8 +1592,13 @@ static int process_header(struct http_ctx *const h, const char *const line, const struct header *const hdr = &headers[i]; int ret; - if (!strncasecmp(line, hdr->header, n) && (ret = hdr->f(h, value))) - return ret; + if (!strncasecmp(line, hdr->header, n)) + { + if ((ret = hdr->f(h, value))) + return ret; + + break; + } } return append_header(h, line, n, value); -- cgit v1.2.3