gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[libmicrohttpd] 03/05: response headers: do not allow "Close" with upgra


From: gnunet
Subject: [libmicrohttpd] 03/05: response headers: do not allow "Close" with upgrade responses
Date: Wed, 11 Aug 2021 21:37:05 +0200

This is an automated email from the git hooks/post-receive script.

karlson2k pushed a commit to branch master
in repository libmicrohttpd.

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

    response headers: do not allow "Close" with upgrade responses
---
 src/microhttpd/response.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/src/microhttpd/response.c b/src/microhttpd/response.c
index a7085767..8e16de3d 100644
--- 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 */

-- 
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]