diff --git a/v2/protocol/http/abuse_protection.go b/v2/protocol/http/abuse_protection.go index 89222a20c..e66369fde 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 + DefaultReadTimeout = 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..4310c91af 100644 --- a/v2/protocol/http/protocol_lifecycle.go +++ b/v2/protocol/http/protocol_lifecycle.go @@ -38,8 +38,9 @@ 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), + ReadHeaderTimeout: DefaultReadTimeout, } // Shutdown