Merge pull request #27 from devn1x/issue-address-validation-ipv6

Fix form validation for IPv6 addresses
This commit is contained in:
benjaminbear 2023-05-25 23:13:18 +02:00 committed by GitHub
commit 523a82caa1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -11,7 +11,7 @@ type Host struct {
gorm.Model
Hostname string `gorm:"unique_index:idx_host_domain;not null" form:"hostname" validate:"required,hostname"`
Domain string `gorm:"unique_index:idx_host_domain;not null" form:"domain" validate:"required,hostname"`
Ip string `form:"ip" validate:"omitempty,ipv4"`
Ip string `form:"ip" validate:"omitempty,ipv4|ipv6"`
Ttl int `form:"ttl" validate:"required,min=20,max=86400"`
LastUpdate time.Time `form:"lastupdate"`
UserName string `gorm:"unique" form:"username" validate:"min=3"`