strip scheme from name

This commit is contained in:
Michael Yang
2024-05-01 12:25:29 -07:00
parent 8867e744ff
commit 88775e1ff9
2 changed files with 27 additions and 3 deletions

View File

@@ -153,12 +153,18 @@ func ParseNameBare(s string) Name {
n.Model = s
return n
}
s, n.Namespace, promised = cutPromised(s, "/")
if !promised {
n.Namespace = s
return n
}
n.Host = s
scheme, host, ok := strings.Cut(s, "://")
if ! ok {
host = scheme
}
n.Host = host
return n
}