From 9da6842601991d1f1067f1126b3794ec46422d80 Mon Sep 17 00:00:00 2001 From: Maneesh Singh Date: Mon, 29 Apr 2024 17:21:49 -0700 Subject: [PATCH] fix: Set IdleTimeout for http.Server (#1418) --- httpserver/server.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/httpserver/server.go b/httpserver/server.go index bca7db43a..9f3403cf1 100644 --- a/httpserver/server.go +++ b/httpserver/server.go @@ -42,6 +42,7 @@ const ( certName = "tls.crt" keyName = "tls.key" readHeaderTimeout = 5 * time.Second + idleTimeout = 90 * time.Second defaultMutationReferrerStoreName = "oras" DefaultMetricsType = "prometheus" @@ -135,6 +136,7 @@ func (server *Server) Run(certRotatorReady chan struct{}) error { Addr: server.Address, Handler: server.Router, ReadHeaderTimeout: readHeaderTimeout, + IdleTimeout: idleTimeout, } if server.CertDirectory != "" {