diff --git a/modules/caddyhttp/encode/encode.go b/modules/caddyhttp/encode/encode.go index b2f3b5d66092..2336eb3cee5f 100644 --- a/modules/caddyhttp/encode/encode.go +++ b/modules/caddyhttp/encode/encode.go @@ -207,6 +207,7 @@ func (rw *responseWriter) Flush() { // to rw.Write (see bug in #4314) return } + //nolint:bodyclose http.NewResponseController(rw).Flush() } @@ -219,6 +220,7 @@ func (rw *responseWriter) Hijack() (net.Conn, *bufio.ReadWriter, error) { } rw.wroteHeader = true } + //nolint:bodyclose return http.NewResponseController(rw).Hijack() } diff --git a/modules/caddyhttp/responsewriter.go b/modules/caddyhttp/responsewriter.go index 9b05ff0ead58..37c264634c88 100644 --- a/modules/caddyhttp/responsewriter.go +++ b/modules/caddyhttp/responsewriter.go @@ -231,6 +231,7 @@ func (rr *responseRecorder) WriteResponse() error { } func (rr *responseRecorder) Hijack() (net.Conn, *bufio.ReadWriter, error) { + //nolint:bodyclose conn, brw, err := http.NewResponseController(rr.ResponseWriterWrapper).Hijack() if err != nil { return nil, nil, err diff --git a/modules/caddyhttp/reverseproxy/streaming.go b/modules/caddyhttp/reverseproxy/streaming.go index 24b25de45f0c..bfeca71e5fdf 100644 --- a/modules/caddyhttp/reverseproxy/streaming.go +++ b/modules/caddyhttp/reverseproxy/streaming.go @@ -456,6 +456,7 @@ func (m *maxLatencyWriter) Write(p []byte) (n int, err error) { defer m.mu.Unlock() n, err = m.dst.Write(p) if m.latency < 0 { + //nolint:errcheck m.flush() return } @@ -477,6 +478,7 @@ func (m *maxLatencyWriter) delayedFlush() { if !m.flushPending { // if stop was called but AfterFunc already started this goroutine return } + //nolint:errcheck m.flush() m.flushPending = false }