fix: tighten responses SSE review follow-up

This commit is contained in:
trph
2026-03-29 22:10:28 +08:00
parent c03883ccf0
commit 0fcc02fbea
2 changed files with 17 additions and 9 deletions
@@ -33,9 +33,13 @@ func writeResponsesSSEChunk(w io.Writer, chunk []byte) {
return
}
if bytes.HasSuffix(chunk, []byte("\n")) {
_, _ = w.Write([]byte("\n"))
if _, err := w.Write([]byte("\n")); err != nil {
return
}
} else {
_, _ = w.Write([]byte("\n\n"))
if _, err := w.Write([]byte("\n\n")); err != nil {
return
}
}
}