mirror of
https://github.com/caddyserver/caddy.git
synced 2024-11-22 14:11:50 +08:00
caddyhttp: suppress flushing if the response is being buffered (#6150)
* suppress flushing if the response is being buffered * fix lint --------- Co-authored-by: Matt Holt <mholt@users.noreply.github.com>
This commit is contained in:
parent
1bd598e90c
commit
c93e30454f
|
@ -230,6 +230,16 @@ func (rr *responseRecorder) WriteResponse() error {
|
|||
return err
|
||||
}
|
||||
|
||||
// FlushError will suppress actual flushing if the response is buffered. See:
|
||||
// https://github.com/caddyserver/caddy/issues/6144
|
||||
func (rr *responseRecorder) FlushError() error {
|
||||
if rr.stream {
|
||||
//nolint:bodyclose
|
||||
return http.NewResponseController(rr.ResponseWriterWrapper).Flush()
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (rr *responseRecorder) Hijack() (net.Conn, *bufio.ReadWriter, error) {
|
||||
//nolint:bodyclose
|
||||
conn, brw, err := http.NewResponseController(rr.ResponseWriterWrapper).Hijack()
|
||||
|
|
Loading…
Reference in New Issue
Block a user