From b97eb2b858509dfc9957829e954ded65d36d8bd7 Mon Sep 17 00:00:00 2001 From: Patrick Devine Date: Sat, 25 Oct 2025 10:57:10 -0700 Subject: [PATCH] cloud: set the proxy content-type to the same as local models (#12759) --- server/routes.go | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/server/routes.go b/server/routes.go index f1770cb70c..3d32a9aad9 100644 --- a/server/routes.go +++ b/server/routes.go @@ -289,6 +289,12 @@ func (s *Server) GenerateHandler(c *gin.Context) { return } + contentType := "application/json; charset=utf-8" + if req.Stream != nil && *req.Stream { + contentType = "application/x-ndjson" + } + c.Header("Content-Type", contentType) + return } @@ -1932,6 +1938,12 @@ func (s *Server) ChatHandler(c *gin.Context) { return } + contentType := "application/json; charset=utf-8" + if req.Stream != nil && *req.Stream { + contentType = "application/x-ndjson" + } + c.Header("Content-Type", contentType) + return }