1
Fork 0
mirror of https://github.com/jech/galene.git synced 2024-11-09 18:25:58 +01:00

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.
This commit is contained in:
Juliusz Chroboczek 2022-10-09 12:37:13 +02:00
parent 6e7a5f8cc6
commit 31ed146a95

View file

@ -333,8 +333,12 @@ func groupHandler(w http.ResponseWriter, r *http.Request) {
} }
func groupBase(r *http.Request) string { func groupBase(r *http.Request) string {
scheme := "https"
if r.TLS == nil {
scheme = "http"
}
base := url.URL{ base := url.URL{
Scheme: r.URL.Scheme, Scheme: scheme,
Host: r.Host, Host: r.Host,
Path: "/group/", Path: "/group/",
} }