From 6fe9d0b531236a1ecdb17b2d6cfca1e0afaf86f0 Mon Sep 17 00:00:00 2001 From: Till Faelligen <2353100+S7evinK@users.noreply.github.com> Date: Sat, 25 Nov 2023 21:19:47 +0100 Subject: [PATCH] Revert "Use url.Parse instead of verifying just the prefix" This reverts commit e45b125d3abc2f197b64cab5446e1293db7c37a6. --- setup/config/config_global.go | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/setup/config/config_global.go b/setup/config/config_global.go index 0d9b79202..a5444d570 100644 --- a/setup/config/config_global.go +++ b/setup/config/config_global.go @@ -3,7 +3,6 @@ package config import ( "fmt" "math/rand" - "net/url" "strconv" "strings" "time" @@ -117,14 +116,8 @@ func (c *Global) Verify(configErrs *ConfigErrors) { checkNotEmpty(configErrs, "global.private_key", string(c.PrivateKeyPath)) // Check that client well-known has a proper format - - if c.WellKnownClientName != "" { - parsedURL, err := url.Parse(c.WellKnownClientName) - if err != nil { - logrus.WithError(err).Warn("The configuration for well_known_client_name does not have a proper format, consider adding http:// or https://. Some clients may fail to connect.") - } else { - c.WellKnownClientName = parsedURL.String() - } + if c.WellKnownClientName != "" && !(strings.HasPrefix(c.WellKnownClientName, "http://") || strings.HasPrefix(c.WellKnownClientName, "https://")) { + logrus.Warn("The configuration for well_known_client_name does not have a proper format, consider adding http:// or https://. Some clients may fail to connect.") } for _, v := range c.VirtualHosts {