diff options
| author | Xavier Del Campo Romero <xavi92@disroot.org> | 2026-02-27 11:51:12 +0100 |
|---|---|---|
| committer | Xavier Del Campo Romero <xavi92@disroot.org> | 2026-02-27 11:51:12 +0100 |
| commit | 469410001bf283b658515391514d4c2077731d04 (patch) | |
| tree | f25f2bd6f60614214f86cc5f28e08c1849c1c05b | |
| parent | 62ee3ef1ca13872e1f9b07f6e4e53cea8b684d72 (diff) | |
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.
| -rw-r--r-- | http.c | 9 |
1 files changed, 7 insertions, 2 deletions
@@ -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); |
