summaryrefslogtreecommitdiff
path: root/modules/caddyhttp/encode
diff options
context:
space:
mode:
authorFrancis Lavoie <lavofr@gmail.com>2023-08-02 20:21:11 -0400
committerGitHub <noreply@github.com>2023-08-02 18:21:11 -0600
commit19139307833fcb36d8af612dfc982b49032f259e (patch)
tree772b7979bb7371083abf45a37d2c0e2f26c69889 /modules/caddyhttp/encode
parentcd486c25d168caf58f4b6fe5d3252df9432901ec (diff)
encode: Fix infinite recursion (#5672)
Diffstat (limited to 'modules/caddyhttp/encode')
-rw-r--r--modules/caddyhttp/encode/encode.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/modules/caddyhttp/encode/encode.go b/modules/caddyhttp/encode/encode.go
index e906d0a..ed3e59d 100644
--- a/modules/caddyhttp/encode/encode.go
+++ b/modules/caddyhttp/encode/encode.go
@@ -212,7 +212,7 @@ func (rw *responseWriter) Flush() {
return
}
//nolint:bodyclose
- http.NewResponseController(rw).Flush()
+ http.NewResponseController(rw.ResponseWriter).Flush()
}
// Hijack implements http.Hijacker. It will flush status code if set. We don't track actual hijacked
@@ -225,7 +225,7 @@ func (rw *responseWriter) Hijack() (net.Conn, *bufio.ReadWriter, error) {
rw.wroteHeader = true
}
//nolint:bodyclose
- return http.NewResponseController(rw).Hijack()
+ return http.NewResponseController(rw.ResponseWriter).Hijack()
}
// Write writes to the response. If the response qualifies,