Hello Jonathon!
welcome to the party:
https://marc.info/?t=158334391200003
especially the two comments by sthen@:
https://marc.info/?m=161349608614743
https://marc.info/?m=161350666619371
reyk@ removed from CC: on purpose:
https://twitter.com/reykfloeter/status/1284868070901776384
Marcus
[email protected] (Jonathon Fletcher), 2021.03.06 (Sat) 21:02 (CET):
> When relayd relays a connection upgrade to a websocket, it relays
> the outbound "Connection: Upgrade" header from the interal server.
>
> It also tags on a "Connection: close" header to the outbound
> response - ie the response goes out with two "Connection"
> header lines.
>
> Chrome and Netscape work despite the double upgrade/close connection
> headers. Safari fails.
>
> Small patch below against 6.8 to only send the "Connection: close"
> header if we are not handling a http_status 101.
>
> Thanks,
> Jonathon
>
>
> cvs -q -d /cvs diff -ub -rOPENBSD_6_8 usr.sbin/relayd/relay_http.c
>
>
> Index: usr.sbin/relayd/relay_http.c
> ===================================================================
> RCS file: /cvs/src/usr.sbin/relayd/relay_http.c,v
> retrieving revision 1.79
> diff -u -p -u -b -r1.79 relay_http.c
> --- usr.sbin/relayd/relay_http.c 4 Sep 2020 13:09:14 -0000 1.79
> +++ usr.sbin/relayd/relay_http.c 6 Mar 2021 19:46:56 -0000
> @@ -526,7 +526,7 @@ relay_read_http(struct bufferevent *bev,
> * Ask the server to close the connection after this request
> * since we don't read any further request headers.
> */
> - if (cre->toread == TOREAD_UNLIMITED)
> + if (cre->toread == TOREAD_UNLIMITED && desc->http_status != 101)
> if (kv_add(&desc->http_headers, "Connection",
> "close", 0) == NULL)
> goto fail;
>