From e6bb113f3535352574937fd6a5646f9d2316a853 Mon Sep 17 00:00:00 2001 From: CaIon <1808837298@qq.com> Date: Mon, 18 Sep 2023 23:06:00 +0800 Subject: [PATCH] fix bug --- middleware/distributor.go | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/middleware/distributor.go b/middleware/distributor.go index c171ffa6..71235b34 100644 --- a/middleware/distributor.go +++ b/middleware/distributor.go @@ -46,14 +46,7 @@ func Distribute() func(c *gin.Context) { if modelRequest.Model == "" { modelRequest.Model = "midjourney" } - } else { - err := common.UnmarshalBodyReusable(c, &modelRequest) - if err != nil { - abortWithMessage(c, http.StatusBadRequest, "无效的请求") - return - } - } - if !strings.HasPrefix(c.Request.URL.Path, "/v1/audio") { + } else if !strings.HasPrefix(c.Request.URL.Path, "/v1/audio") { err = common.UnmarshalBodyReusable(c, &modelRequest) } if err != nil {