cloud: set the proxy content-type to the same as local models (#12759)

This commit is contained in:
Patrick Devine
2025-10-25 10:57:10 -07:00
committed by GitHub
parent ad6f6a1d29
commit b97eb2b858

View File

@@ -289,6 +289,12 @@ func (s *Server) GenerateHandler(c *gin.Context) {
return return
} }
contentType := "application/json; charset=utf-8"
if req.Stream != nil && *req.Stream {
contentType = "application/x-ndjson"
}
c.Header("Content-Type", contentType)
return return
} }
@@ -1932,6 +1938,12 @@ func (s *Server) ChatHandler(c *gin.Context) {
return return
} }
contentType := "application/json; charset=utf-8"
if req.Stream != nil && *req.Stream {
contentType = "application/x-ndjson"
}
c.Header("Content-Type", contentType)
return return
} }