Skip to content

Commit d7efbab

Browse files
committed
Ensure ASCII base domains are always lowercased
1 parent da34dba commit d7efbab

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

pkg/code/thirdparty/domain.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ import (
1111
"github.com/pkg/errors"
1212
"golang.org/x/net/idna"
1313

14-
"github.com/code-payments/code-server/pkg/netutil"
1514
"github.com/code-payments/code-server/pkg/code/common"
15+
"github.com/code-payments/code-server/pkg/netutil"
1616
)
1717

1818
// DomainVerifier is a validation function to verify if a public key is owned by a domain.
@@ -85,5 +85,5 @@ func GetAsciiBaseDomain(domain string) (string, error) {
8585
if len(parts) < 2 {
8686
return "", errors.New("value must have base domain and tld")
8787
}
88-
return fmt.Sprintf("%s.%s", parts[len(parts)-2], parts[len(parts)-1]), nil
88+
return strings.ToLower(fmt.Sprintf("%s.%s", parts[len(parts)-2], parts[len(parts)-1])), nil
8989
}

0 commit comments

Comments
 (0)