Sfoglia il codice sorgente

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

Co-authored-by: rootedbox
Timothy Jaeryang Baek 1 anno fa
parent
commit
c2e3b89176
1 ha cambiato i file con 5 aggiunte e 0 eliminazioni
  1. 5 0
      server/routes.go

+ 5 - 0
server/routes.go

@@ -416,6 +416,11 @@ func CreateModelHandler(c *gin.Context) {
 		return
 		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 == "" {
 	if req.Path == "" && req.Modelfile == "" {
 		c.AbortWithStatusJSON(http.StatusBadRequest, gin.H{"error": "path or modelfile are required"})
 		c.AbortWithStatusJSON(http.StatusBadRequest, gin.H{"error": "path or modelfile are required"})
 		return
 		return