From 31ed146a959ec7602b82e8573abe540cba4461df Mon Sep 17 00:00:00 2001 From: Juliusz Chroboczek Date: Sun, 9 Oct 2022 12:37:13 +0200 Subject: [PATCH] Fix computation of group URL in webserver. We were computing the scheme incorrectly, which caused us to compute the wrong websocket URL when -insecure is set. Thanks to Fabien de Montgolfier. --- webserver/webserver.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/webserver/webserver.go b/webserver/webserver.go index b3dd5ee..d06a0bb 100644 --- a/webserver/webserver.go +++ b/webserver/webserver.go @@ -333,8 +333,12 @@ func groupHandler(w http.ResponseWriter, r *http.Request) { } func groupBase(r *http.Request) string { + scheme := "https" + if r.TLS == nil { + scheme = "http" + } base := url.URL{ - Scheme: r.URL.Scheme, + Scheme: scheme, Host: r.Host, Path: "/group/", }