diff --git a/proxy/proxymanager.go b/proxy/proxymanager.go index deb017b..5dd8a8d 100644 --- a/proxy/proxymanager.go +++ b/proxy/proxymanager.go @@ -374,7 +374,8 @@ func (pm *ProxyManager) proxyOAIHandler(c *gin.Context) { // dechunk it as we already have all the body bytes see issue #11 c.Request.Header.Del("transfer-encoding") - c.Request.Header.Add("content-length", strconv.Itoa(len(bodyBytes))) + c.Request.Header.Set("content-length", strconv.Itoa(len(bodyBytes))) + c.Request.ContentLength = int64(len(bodyBytes)) if err := processGroup.ProxyRequest(realModelName, c.Writer, c.Request); err != nil { pm.sendErrorResponse(c, http.StatusInternalServerError, fmt.Sprintf("error proxying request: %s", err.Error()))