mirror of
https://github.com/dogkeeper886/ollama37.git
synced 2025-12-10 15:57:04 +00:00
use content type application/x-ndjson for streaming responses
This commit is contained in:
@@ -367,6 +367,7 @@ func Serve(ln net.Listener, extraOrigins []string) error {
|
||||
}
|
||||
|
||||
func streamResponse(c *gin.Context, ch chan any) {
|
||||
c.Header("Content-Type", "application/x-ndjson")
|
||||
c.Stream(func(w io.Writer) bool {
|
||||
val, ok := <-ch
|
||||
if !ok {
|
||||
|
||||
Reference in New Issue
Block a user