Skip to content

Commit

Permalink
ValidateDomainの中で検証
Browse files Browse the repository at this point in the history
  • Loading branch information
pirosiki197 committed Oct 21, 2023
1 parent 8f9451f commit f597a24
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions pkg/domain/app_website.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@ import (
)

func ValidateDomain(domain string) error {
// ドメインが大文字を含むときはエラー
if domain != strings.ToLower(domain) {
return errors.Errorf("domain %v must be lower case", domain)
}
// 面倒なのでtrailing dotは無しで統一
if strings.HasSuffix(domain, ".") {
return errors.Errorf("trailing dot not allowed in domain %v", domain)
Expand Down

0 comments on commit f597a24

Please sign in to comment.