From 330c9b258b6ef14eb06daf899606ea47dcad5350 Mon Sep 17 00:00:00 2001 From: Sameeh Jubran Date: Thu, 9 Apr 2026 13:32:58 +0300 Subject: [PATCH] wc_http_sig: remove extra braces around header lookup loop Signed-off-by: Sameeh Jubran --- http-message-signatures/common/wc_http_sig.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/http-message-signatures/common/wc_http_sig.c b/http-message-signatures/common/wc_http_sig.c index d2afdea8..2098e60b 100644 --- a/http-message-signatures/common/wc_http_sig.c +++ b/http-message-signatures/common/wc_http_sig.c @@ -104,6 +104,8 @@ static const char* resolve_component(const char* name, const wc_HttpHeader* headers, int headerCount) { + int i; + if (name[0] == '@') { if (XSTRCMP(name, "@method") == 0) return method; if (XSTRCMP(name, "@authority") == 0) return authority; @@ -113,12 +115,9 @@ static const char* resolve_component(const char* name, } /* Search headers case-insensitively */ - { - int i; - for (i = 0; i < headerCount; i++) { - if (strcasecmp_internal(headers[i].name, name) == 0) - return headers[i].value; - } + for (i = 0; i < headerCount; i++) { + if (strcasecmp_internal(headers[i].name, name) == 0) + return headers[i].value; } return NULL; }