client_golang icon indicating copy to clipboard operation
client_golang copied to clipboard

Support the SetWriteDeadline and SetReadDeadline interfaces

Open Mik- opened this issue 1 year ago • 0 comments

I'm using the new ResponseController, introduced in Go 1.20 to set a timeout on the response writer. Your delegator did not respect the new interfaces SetWriteDeadline and SetReadDeadline.

Example:

rc := http.NewResponseController(w)
err = rc.SetWriteDeadline(time.Now().Add(5 * time.Second)) // returns ErrNotSupported

It would be nice, if the InstrumentHandlerDuration or InstrumentHandlerCounter would support this.

I'm currently using v1.18.0.

Mik- avatar Jan 31 '24 15:01 Mik-