libmicrohttpd

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

commit f2565a62da98879ac60fc17b633a88021f37faa9
parent 8105f71cc5239b41e5a17e0b7d41bb92a234ee00
Author: Evgeny Grin (Karlson2k) <k2k@narod.ru>
Date:   Sun, 13 Mar 2022 20:31:45 +0300

MHD_set_response_options(): check whether the new flags could be used

Diffstat:
Msrc/microhttpd/response.c | 7+++++++
1 file changed, 7 insertions(+), 0 deletions(-)

diff --git a/src/microhttpd/response.c b/src/microhttpd/response.c @@ -895,8 +895,15 @@ MHD_set_response_options (struct MHD_Response *response, enum MHD_Result ret; enum MHD_ResponseOptions ro; + if ( (0 != (response->flags & MHD_RF_INSANITY_HEADER_CONTENT_LENGTH)) && + (0 == (flags & MHD_RF_INSANITY_HEADER_CONTENT_LENGTH))) + { /* Request to remove MHD_RF_INSANITY_HEADER_CONTENT_LENGTH flag */ + if (0 != (response->flags_auto & MHD_RAF_HAS_CONTENT_LENGTH)) + return MHD_NO; + } ret = MHD_YES; response->flags = flags; + va_start (ap, flags); while (MHD_RO_END != (ro = va_arg (ap, enum MHD_ResponseOptions))) {