feat: don't allow full stops in domains
1 files changed, 6 insertions(+), 0 deletions(-) M internal/handlers/domains.go
M internal/handlers/domains.go => internal/handlers/domains.go +6 -0
@@ 10,6 10,7 @@ import ( "log" "net" "net/http" "strings" "git.src.quest/~skye/felu-ddns/internal/db" @@ "github.com/gin-gonic/gin" 34,6 35,11 @@ func PostDomain() gin.HandlerFunc { c.Abort() return } if strings.Contains(data.Domain, ".") { c.String(http.StatusBadRequest, "Domain can't contain full stops") c.Abort() return } if net.ParseIP(data.ARecord).To4() == nil { c.String(http.StatusBadRequest, "The A record is invalid") c.Abort()