diff --git a/v2/protocol/http/abuse_protection.go b/v2/protocol/http/abuse_protection.go index 89222a20c..48f03fb6c 100644 --- a/v2/protocol/http/abuse_protection.go +++ b/v2/protocol/http/abuse_protection.go @@ -12,6 +12,7 @@ import ( "net/http" "strconv" "strings" + "time" ) type WebhookConfig struct { @@ -23,6 +24,7 @@ type WebhookConfig struct { const ( DefaultAllowedRate = 1000 + DefaultTimeout = time.Second * 600 ) // TODO: implement rate limiting. diff --git a/v2/protocol/http/protocol_lifecycle.go b/v2/protocol/http/protocol_lifecycle.go index dacfd30f6..04ef96915 100644 --- a/v2/protocol/http/protocol_lifecycle.go +++ b/v2/protocol/http/protocol_lifecycle.go @@ -38,8 +38,10 @@ func (p *Protocol) OpenInbound(ctx context.Context) error { } p.server = &http.Server{ - Addr: listener.Addr().String(), - Handler: attachMiddleware(p.Handler, p.middleware), + Addr: listener.Addr().String(), + Handler: attachMiddleware(p.Handler, p.middleware), + ReadTimeout: DefaultTimeout, + WriteTimeout: DefaultTimeout, } // Shutdown