Skip to content

Commit

Permalink
encode: Fix infinite recursion (#5672)
Browse files Browse the repository at this point in the history
  • Loading branch information
francislavoie authored Aug 3, 2023
1 parent cd486c2 commit 1913930
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions modules/caddyhttp/encode/encode.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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,
Expand Down

0 comments on commit 1913930

Please sign in to comment.