From 0c347d2f9e1c42e521b47871910787e1abc799b9 Mon Sep 17 00:00:00 2001 From: Yannick Alexander Date: Wed, 1 Apr 2026 10:58:34 +0200 Subject: [PATCH] added comment for host regex Signed-off-by: Yannick Alexander --- pkg/registry/client.go | 2 ++ 1 file changed, 2 insertions(+) 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.