fix: streaming for amp cli

This commit is contained in:
teeverc
2025-12-13 13:17:53 -08:00
parent 1215c635a0
commit 52d5fd1a67

View File

@@ -39,7 +39,11 @@ func (rw *ResponseRewriter) Write(data []byte) (int, error) {
} }
if rw.isStreaming { if rw.isStreaming {
return rw.ResponseWriter.Write(rw.rewriteStreamChunk(data)) n, err := rw.ResponseWriter.Write(rw.rewriteStreamChunk(data))
if flusher, ok := rw.ResponseWriter.(http.Flusher); ok {
flusher.Flush()
}
return n, err
} }
return rw.body.Write(data) return rw.body.Write(data)
} }