Skip to content

Commit

Permalink
middleware.Compress: implement Unwrap() method to the compressRespons…
Browse files Browse the repository at this point in the history
…eWriter (#819)
  • Loading branch information
kei2100 committed May 2, 2023
1 parent 77d709f commit 8cbdac6
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions middleware/compress.go
Original file line number Diff line number Diff line change
Expand Up @@ -382,6 +382,10 @@ func (cw *compressResponseWriter) Close() error {
return errors.New("chi/middleware: io.WriteCloser is unavailable on the writer")
}

func (cw *compressResponseWriter) Unwrap() http.ResponseWriter {
return cw.ResponseWriter
}

func encoderGzip(w io.Writer, level int) io.Writer {
gw, err := gzip.NewWriterLevel(w, level)
if err != nil {
Expand Down

0 comments on commit 8cbdac6

Please sign in to comment.