diff --git a/node/pkg/node/url_verification.go b/node/pkg/node/url_verification.go index 265d925989..2100994f5e 100644 --- a/node/pkg/node/url_verification.go +++ b/node/pkg/node/url_verification.go @@ -5,6 +5,7 @@ import ( "log" "net" "net/url" + "slices" "strings" "github.com/spf13/cobra" @@ -33,12 +34,7 @@ func validateURL(urlStr string, validSchemes []string) bool { return false } - for _, scheme := range validSchemes { - if parsedURL.Scheme == scheme { - return true - } - } - return false + return slices.Contains(validSchemes, parsedURL.Scheme) } func generateFormatString(schemes []string) string {