From 86cd2802d5a6fe74225adce0d682903f329ad2ce Mon Sep 17 00:00:00 2001 From: feitianbubu Date: Thu, 23 Oct 2025 22:14:15 +0800 Subject: [PATCH] fix: fail get moel by multipart/form-data; boundary --- middleware/distributor.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/middleware/distributor.go b/middleware/distributor.go index 3f710399..9faee801 100644 --- a/middleware/distributor.go +++ b/middleware/distributor.go @@ -246,7 +246,7 @@ func getModelRequest(c *gin.Context) (*ModelRequest, bool, error) { modelRequest.Model = common.GetStringIfEmpty(modelRequest.Model, "dall-e") } else if strings.HasPrefix(c.Request.URL.Path, "/v1/images/edits") { //modelRequest.Model = common.GetStringIfEmpty(c.PostForm("model"), "gpt-image-1") - contentType := c.Request.Header.Get("Content-Type") + contentType := c.ContentType() if slices.Contains([]string{gin.MIMEPOSTForm, gin.MIMEMultipartPOSTForm}, contentType) { modelRequest.Model = c.PostForm("model") }