fix: disable ':' in tag names (#1280)

Co-authored-by: rootedbox
This commit is contained in:
Timothy Jaeryang Baek 2023-11-29 13:33:45 -05:00 committed by GitHub
parent cde31cb220
commit c2e3b89176
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -416,6 +416,11 @@ func CreateModelHandler(c *gin.Context) {
return
}
if strings.Count(req.Name, ":") > 1 {
c.AbortWithStatusJSON(http.StatusBadRequest, gin.H{"error": "':' (colon) is not allowed in tag names"})
return
}
if req.Path == "" && req.Modelfile == "" {
c.AbortWithStatusJSON(http.StatusBadRequest, gin.H{"error": "path or modelfile are required"})
return