libmicrohttpd

HTTP/1.x server C library (MHD 1.x, stable)
Log | Files | Refs | Submodules | README | LICENSE

commit a083613d8405fa3ad7f6bc5bbbb635d0f50799e0
parent 0d33a88f358f8798be72cb5ffd69229e8932eff8
Author: Evgeny Grin (Karlson2k) <k2k@drgrin.dev>
Date:   Tue, 14 Apr 2026 19:39:50 +0200

Fixed checking headers longer than actually needed

The prevents matching header like "Content-Length-Anything:" as
"Content-Length:" header.

Diffstat:
Msrc/microhttpd/connection.c | 7+++----
1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/src/microhttpd/connection.c b/src/microhttpd/connection.c @@ -4902,10 +4902,9 @@ parse_connection_headers (struct MHD_Connection *connection) for (pos = connection->rq.headers_received; NULL != pos; pos = pos->next) if ( (0 != (pos->kind & MHD_HEADER_KIND)) && - (MHD_str_equal_caseless_bin_n_ (MHD_HTTP_HEADER_CONTENT_LENGTH, - pos->header, - MHD_STATICSTR_LEN_ ( - MHD_HTTP_HEADER_CONTENT_LENGTH))) ) + (MHD_str_equal_caseless_s_bin_n_ (MHD_HTTP_HEADER_CONTENT_LENGTH, + pos->header, + pos->header_size)) ) { const char *clen; size_t val_len;