mirror of
https://github.com/TeaOSLab/EdgeAdmin.git
synced 2025-11-06 06:40:27 +08:00
域名和记录名中可以使用大写
This commit is contained in:
@@ -18,7 +18,8 @@ func ValidateDomainFormat(domain string) bool {
|
|||||||
strings.HasPrefix(piece, "-") ||
|
strings.HasPrefix(piece, "-") ||
|
||||||
strings.HasSuffix(piece, "-") ||
|
strings.HasSuffix(piece, "-") ||
|
||||||
len(piece) > 63 ||
|
len(piece) > 63 ||
|
||||||
!regexp.MustCompile(`^[a-z0-9-]+$`).MatchString(piece) {
|
// 我们允许大写字母、下划线,防止有些特殊场景下需要
|
||||||
|
!regexp.MustCompile(`^[_a-zA-Z0-9-]+$`).MatchString(piece) {
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -76,7 +77,8 @@ func ValidateRecordName(name string) bool {
|
|||||||
strings.HasSuffix(piece, "-") ||
|
strings.HasSuffix(piece, "-") ||
|
||||||
//strings.Contains(piece, "--") ||
|
//strings.Contains(piece, "--") ||
|
||||||
len(piece) > 63 ||
|
len(piece) > 63 ||
|
||||||
!regexp.MustCompile(`^[_a-z0-9-]+$`).MatchString(piece) {
|
// 我们允许大写字母、下划线,防止有些特殊场景下需要
|
||||||
|
!regexp.MustCompile(`^[_a-zA-Z0-9-]+$`).MatchString(piece) {
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user