libmicrohttpd

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

commit 3526ff83027997ccf360b4729dbfef9aa97f236d
parent ad61ffabeb012f342518deb1f711812a68e64cfc
Author: Alexander Irion <alexander_irion@mentor.com>
Date:   Wed, 15 Jun 2022 12:34:49 +0200

Remove double adding of MHD_HTTP_HEADER_CONNECTION response header

MHD_create_response_for_upgrade() already adds the MHD_HTTP_HEADER_CONNECTION response header, so
the additional MHD_add_response_header is wrong.

In our application it caused, that on a Apple iPad, the websocket was immediately closed by the
browser(Safari, Chrome, Opera) after the protocol upgrade. Browsers on Linux, Android did not had this issue.

Signed-off-by: Alexander Irion <alexander_irion@mentor.com>

Diffstat:
Msrc/examples/websocket_chatserver_example.c | 3---
1 file changed, 0 insertions(+), 3 deletions(-)

diff --git a/src/examples/websocket_chatserver_example.c b/src/examples/websocket_chatserver_example.c @@ -2242,9 +2242,6 @@ access_handler (void *cls, * See also: https://tools.ietf.org/html/rfc6455#section-4.2.2 */ MHD_add_response_header (response, - MHD_HTTP_HEADER_CONNECTION, - "Upgrade"); - MHD_add_response_header (response, MHD_HTTP_HEADER_UPGRADE, "websocket"); MHD_add_response_header (response,