Skip to content

Commit c2da744

Browse files
committed
add supprt for go1.20 http.rwUnwrapper
1 parent f22ba67 commit c2da744

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

response.go

+7
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,13 @@ func (r *Response) Hijack() (net.Conn, *bufio.ReadWriter, error) {
9494
return r.Writer.(http.Hijacker).Hijack()
9595
}
9696

97+
// Unwrap returns the original http.ResponseWriter.
98+
// ResponseController can be used to access the original http.ResponseWriter.
99+
// See [https://go.dev/blog/go1.20]
100+
func (r *Response) Unwrap() http.ResponseWriter {
101+
return r.Writer
102+
}
103+
97104
func (r *Response) reset(w http.ResponseWriter) {
98105
r.beforeFuncs = nil
99106
r.afterFuncs = nil

0 commit comments

Comments
 (0)