* 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>
17 строки
355 B
Go
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)
|
|
}
|