mirror of
https://github.com/caddyserver/caddy.git
synced 2024-12-16 21:56:40 -05: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
1 changed files with 10 additions and 0 deletions
|
@ -230,6 +230,16 @@ func (rr *responseRecorder) WriteResponse() error {
|
||||||
return err
|
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) {
|
func (rr *responseRecorder) Hijack() (net.Conn, *bufio.ReadWriter, error) {
|
||||||
//nolint:bodyclose
|
//nolint:bodyclose
|
||||||
conn, brw, err := http.NewResponseController(rr.ResponseWriterWrapper).Hijack()
|
conn, brw, err := http.NewResponseController(rr.ResponseWriterWrapper).Hijack()
|
||||||
|
|
Loading…
Reference in a new issue