Skip to content

Commit

Permalink
fix: remove additionnal line break
Browse files Browse the repository at this point in the history
close #107
  • Loading branch information
ncarlier committed Nov 16, 2024
1 parent 0df2a52 commit 379ded5
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions pkg/api/index.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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))
}
})
}
Expand Down

0 comments on commit 379ded5

Please sign in to comment.