Closed eole868 closed 2 years ago
read response body stream when ctx.Response.IsBodyStream() is True, don't copy to resp.bodybuffer
example:
ctx.Response.SendFile("/path/file/") ctx.Response.SetBodyStreamWriter(func(w *bufio.Writer) { buf := make([]byte, 4096) for { n, err := r.Read(buf) if n <= 0 || err != nil { break; } w.Write(buf) } })
Thank you for your PR!
read response body stream when ctx.Response.IsBodyStream() is True, don't copy to resp.bodybuffer
example: