Closed pstibrany closed 1 year ago
This PR adds Unwrap method to all implementations of http.ResponseWriter.
Unwrap
http.ResponseWriter
New https://pkg.go.dev/net/http#ResponseController introduced in Go 1.20 uses Unwrap method to get access to original http.ResponseWriter or underlying connection.
My use case: I'd like to use http.ResponseController to set longer timeouts on HTTP endpoints for uploading big files, overriding global -server.http-write-timeout and -server.http-read-timeout.
http.ResponseController
-server.http-write-timeout
-server.http-read-timeout
This PR also updates httpsnoop library to version 1.0.3, which supports Unwrap method as well (since 1.0.2) (https://github.com/felixge/httpsnoop/issues/8).
(To make weaveworks/common fully compatible with new http.ResponseController, opentracing-contrib/go-stdlib library needs an update too, after https://github.com/opentracing-contrib/go-stdlib/pull/68 is merged).
opentracing-contrib/go-stdlib
This PR adds
Unwrap
method to all implementations ofhttp.ResponseWriter
.New https://pkg.go.dev/net/http#ResponseController introduced in Go 1.20 uses
Unwrap
method to get access to originalhttp.ResponseWriter
or underlying connection.My use case: I'd like to use
http.ResponseController
to set longer timeouts on HTTP endpoints for uploading big files, overriding global-server.http-write-timeout
and-server.http-read-timeout
.This PR also updates httpsnoop library to version 1.0.3, which supports
Unwrap
method as well (since 1.0.2) (https://github.com/felixge/httpsnoop/issues/8).(To make weaveworks/common fully compatible with new
http.ResponseController
,opentracing-contrib/go-stdlib
library needs an update too, after https://github.com/opentracing-contrib/go-stdlib/pull/68 is merged).