mirror of
https://github.com/ollama/ollama.git
synced 2025-11-10 17:17:56 +01:00
cloud: set the proxy content-type to the same as local models (#12759)
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user