Explorar o código

Fix model name length validation limit

Calcium-Ion hai 1 ano
pai
achega
4cf9d0787e
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  1. 1 1
      controller/channel.go

+ 1 - 1
controller/channel.go

@@ -277,7 +277,7 @@ func AddChannel(c *gin.Context) {
 		// Validate the length of the model name
 		// Validate the length of the model name
 		models := strings.Split(localChannel.Models, ",")
 		models := strings.Split(localChannel.Models, ",")
 		for _, model := range models {
 		for _, model := range models {
-			if len(model) > 256 {
+			if len(model) > 255 {
 				c.JSON(http.StatusOK, gin.H{
 				c.JSON(http.StatusOK, gin.H{
 					"success": false,
 					"success": false,
 					"message": fmt.Sprintf("模型名称过长: %s", model),
 					"message": fmt.Sprintf("模型名称过长: %s", model),