libmicrohttpd

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

commit af3fc639b339e60d7d626d8809589b32548f4dcb
parent 88da9c6f157b68d8b129c03f4f60a446ecd6121c
Author: Evgeny Grin (Karlson2k) <k2k@narod.ru>
Date:   Wed, 11 Aug 2021 22:23:44 +0300

response headers: do not allow "Close" with upgrade responses

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 @@ -266,6 +266,13 @@ add_response_header_connection (struct MHD_Response *response, "close"), buf + old_value_len, &norm_len); +#ifdef UPGRADE_SUPPORT + if ( (NULL != response->upgrade_handler) && value_has_close) + { /* The "close" token cannot be used with connection "upgrade" */ + free (buf); + return MHD_NO; + } +#endif /* UPGRADE_SUPPORT */ mhd_assert (0 <= norm_len); if (0 > norm_len) norm_len = 0; /* Must never happen */