Skip to content

Commit

Permalink
Ensure ASCII base domains are always lowercased
Browse files Browse the repository at this point in the history
  • Loading branch information
jeffyanta committed Dec 15, 2023
1 parent da34dba commit d7efbab
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pkg/code/thirdparty/domain.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ import (
"github.com/pkg/errors"
"golang.org/x/net/idna"

"github.com/code-payments/code-server/pkg/netutil"
"github.com/code-payments/code-server/pkg/code/common"
"github.com/code-payments/code-server/pkg/netutil"
)

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

0 comments on commit d7efbab

Please sign in to comment.