diff --git a/pkg/registry/client.go b/pkg/registry/client.go index be1f87b52..33ece53f1 100644 --- a/pkg/registry/client.go +++ b/pkg/registry/client.go @@ -227,6 +227,8 @@ type ( } ) +// hostRegex is a pretty naive regex for validating host urls. The goal of it is not to ultimately validate all possible valid hosts, +// but to catch common user errors such as including a scheme or path in the host string. var hostRegex = regexp.MustCompile(`^(?P[a-z]*:\/\/)?(?P[a-zA-Z0-9-\.\:]+)(?P\/.*)?$`) // validateHost checks that the host matches some required pre-checks e.g. does not contain a scheme or path.