From 56fbe9d62b276f3c4370a5483ba9372946282496 Mon Sep 17 00:00:00 2001 From: unknown Date: Sun, 24 Sep 2023 20:54:51 -0700 Subject: [PATCH] Do something about invalid well-known names --- clientapi/routing/routing.go | 2 +- federationapi/routing/routing.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/clientapi/routing/routing.go b/clientapi/routing/routing.go index 89de79f43..93021fc41 100644 --- a/clientapi/routing/routing.go +++ b/clientapi/routing/routing.go @@ -129,7 +129,7 @@ func Setup( })).Methods(http.MethodGet, http.MethodOptions) } - if !strings.HasPrefix(string(cfg.Matrix.ServerName), "http://") && !strings.HasPrefix(string(cfg.Matrix.ServerName), "https://") { + if !strings.HasPrefix(string(cfg.Matrix.ServerName), "http://") || !strings.HasPrefix(string(cfg.Matrix.ServerName), "https://") { logrus.Warn("The well_known_server_name does not start with http:// or https:// does not start with 'http://' or 'https://'. Some clients may fail to connect.") } diff --git a/federationapi/routing/routing.go b/federationapi/routing/routing.go index ac651a020..59b80307b 100644 --- a/federationapi/routing/routing.go +++ b/federationapi/routing/routing.go @@ -124,7 +124,7 @@ func Setup( ).Methods(http.MethodGet, http.MethodOptions) } - if !strings.HasPrefix(string(cfg.Matrix.ServerName), "http://") && !strings.HasPrefix(string(cfg.Matrix.ServerName), "https://") { + if !strings.HasPrefix(string(cfg.Matrix.ServerName), "http://") || !strings.HasPrefix(string(cfg.Matrix.ServerName), "https://") { logrus.Warn("The well_known_server_name does not start with http:// or https:// does not start with 'http://' or 'https://'. Some clients may fail to connect.") }