go-stdlib
go-stdlib copied to clipboard
Make metricsTracker implement Unwrap method.
New https://pkg.go.dev/net/http#ResponseController introduced in Go 1.20 uses Unwrap
method on http.ResponseWriter
implementations to get access to original http.ResponseWriter
or underlying connection.
This PR adds Unwrap
method to *nethttp.metricsTracker
, which is a single implementation of http.ResponseWriter
in this library. This makes it possible to use new http.ResponseController
with responses wrapped by this library.
Note that metricsTracker
implementation is based on httpsnoop, which now also supports Unwrap method: https://github.com/felixge/httpsnoop/issues/8.