Merge branch 'router-for-me:main' into main

This commit is contained in:
Luis Pater
2025-12-14 16:19:29 +08:00
committed by GitHub
3 changed files with 49 additions and 15 deletions

View File

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