Files
mostlymatter/vendor/github.com/rudderlabs/analytics-go/timeout_15.go
George Goldberg 6cabc40e62 MM-23568: Add rudder to server diagnostics. (#14151)
* MM-23568: Add rudder to server diagnostics.

* Add unit test.

* Go mod tidy.

* CSP Header fix.

* Fix review comments.

* Update web/handlers.go

Co-Authored-By: Jesse Hallam <jesse.hallam@gmail.com>

* Partially address review comments.

* fix tests.

* Finish implementing review suggestions and then fixing tests.

* Fix CSP Header tests.

Co-authored-by: Jesse Hallam <jesse.hallam@gmail.com>
2020-04-21 09:23:00 +01:00

17 строки
355 B
Go

// +build !go1.6
package analytics
import "net/http"
// http clients on versions of go before 1.6 only support timeout if the
// transport implements the `CancelRequest` method.
func supportsTimeout(transport http.RoundTripper) bool {
_, ok := transport.(requestCanceler)
return ok
}
type requestCanceler interface {
CancelRequest(*http.Request)
}