From c2e3b891760686d163b701be564dcbcab87a8785 Mon Sep 17 00:00:00 2001 From: Timothy Jaeryang Baek Date: Wed, 29 Nov 2023 13:33:45 -0500 Subject: [PATCH] fix: disable ':' in tag names (#1280) Co-authored-by: rootedbox --- server/routes.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/server/routes.go b/server/routes.go index 8b248234..03bf8ace 100644 --- a/server/routes.go +++ b/server/routes.go @@ -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