diff --git a/notifier/notifiers/webhook.go b/notifier/notifiers/webhook.go index 12acd92e..21f48277 100644 --- a/notifier/notifiers/webhook.go +++ b/notifier/notifiers/webhook.go @@ -25,6 +25,7 @@ import ( "io/ioutil" "net/http" "net/url" + "time" "gopkg.in/yaml.v2" @@ -33,6 +34,8 @@ import ( "github.com/coreos/clair/notifier" ) +const timeout = 5 * time.Second + // A WebhookNotifier dispatches notifications to a webhook endpoint. type WebhookNotifier struct { endpoint string @@ -89,6 +92,7 @@ func (h *WebhookNotifier) Configure(config *config.NotifierConfig) (bool, error) Transport: &http.Transport{ TLSClientConfig: tlsConfig, }, + Timeout: timeout, } return true, nil }