fix: remove additionnal line break

close #107
This commit is contained in:
Nicolas Carlier 2024-11-16 16:47:01 +00:00
parent 0df2a5269e
commit 379ded5a8f

View File

@ -180,10 +180,10 @@ func writeStreamedResponse(w http.ResponseWriter, negociatedContentType string,
if bytes.HasPrefix(msg, []byte("error:")) {
prefix = ""
}
fmt.Fprintf(w, "%s%s\n\n", prefix, msg)
fmt.Fprintf(w, "%s%s\n", prefix, msg)
} else {
// Send chunked response
fmt.Fprintf(w, "%s\n", msg)
w.Write(msg)
}
// Flush the data immediately instead of buffering it for later.
@ -220,7 +220,7 @@ func writeStandardResponse(w http.ResponseWriter, negociatedContentType string,
// Write buffer to HTTP response
buffer.Do(func(data interface{}) {
if data != nil {
fmt.Fprintf(w, "%s\n", data.([]byte))
w.Write(data.([]byte))
}
})
}