From 6fcdfd437e78b5f36c7f1df5238224721e46718e Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Tue, 28 Jul 2026 11:03:00 +0200 Subject: [PATCH] fix bogus assertion --- src/microhttpd/connection.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/microhttpd/connection.c b/src/microhttpd/connection.c index 235cac98..b92351ae 100644 --- a/src/microhttpd/connection.c +++ b/src/microhttpd/connection.c @@ -6405,7 +6405,11 @@ get_req_header (struct MHD_Connection *c, else { /* Not a whitespace, not the end of the header line */ - mhd_assert ('\r' != chr); + /* A bare CR reaches this point when it is kept as an ordinary + character ('bare_cr_keep', MHD_OPTION_CLIENT_DISCIPLINE_LVL -3); + in every other mode it is either replaced with a space or + rejected before. */ + mhd_assert (('\r' != chr) || bare_cr_keep); mhd_assert ('\n' != chr); mhd_assert ('\0' != chr); if ( (! c->rq.hdrs.hdr.name_end_found) &&