server: more support for mixed-case model names (#8017)

Fixes #7944
This commit is contained in:
Blake Mizerany
2024-12-11 15:29:59 -08:00
committed by GitHub
parent 36d111e788
commit b1fd7fef86
8 changed files with 123 additions and 38 deletions

View File

@@ -223,12 +223,12 @@ func (n Name) String() string {
func (n Name) DisplayShortest() string {
var sb strings.Builder
if n.Host != defaultHost {
if !strings.EqualFold(n.Host, defaultHost) {
sb.WriteString(n.Host)
sb.WriteByte('/')
sb.WriteString(n.Namespace)
sb.WriteByte('/')
} else if n.Namespace != defaultNamespace {
} else if !strings.EqualFold(n.Namespace, defaultNamespace) {
sb.WriteString(n.Namespace)
sb.WriteByte('/')
}