1
0
mirror of https://github.com/labstack/echo.git synced 2025-07-13 01:30:31 +02:00

add supprt for go1.20 http.rwUnwrapper

This commit is contained in:
imxyb
2023-03-28 17:25:11 +08:00
committed by Martti T
parent c0bc886b78
commit a7802ea523
2 changed files with 15 additions and 0 deletions

View File

@ -94,6 +94,13 @@ func (r *Response) Hijack() (net.Conn, *bufio.ReadWriter, error) {
return r.Writer.(http.Hijacker).Hijack()
}
// Unwrap returns the original http.ResponseWriter.
// ResponseController can be used to access the original http.ResponseWriter.
// See [https://go.dev/blog/go1.20]
func (r *Response) Unwrap() http.ResponseWriter {
return r.Writer
}
func (r *Response) reset(w http.ResponseWriter) {
r.beforeFuncs = nil
r.afterFuncs = nil