From d051c7e41a70f74c392d9da96cd390b76e62a67f Mon Sep 17 00:00:00 2001 From: RinZ27 <222222878+RinZ27@users.noreply.github.com> Date: Thu, 9 Jul 2026 19:25:00 +0700 Subject: [PATCH] server: set ReadHeaderTimeout to 32s on all HTTP servers Signed-off-by: RinZ27 <222222878+RinZ27@users.noreply.github.com> --- v1/server/server.go | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/v1/server/server.go b/v1/server/server.go index becca1c42b..82a8a32418 100644 --- a/v1/server/server.go +++ b/v1/server/server.go @@ -659,8 +659,9 @@ func (s *Server) getListener(addr string, h http.Handler, t httpListenerType) ([ func (s *Server) getListenerForHTTPServer(u *url.URL, h http.Handler, t httpListenerType) (Loop, httpListener, error) { h1s := http.Server{ - Addr: u.Host, - Handler: h, + Addr: u.Host, + Handler: h, + ReadHeaderTimeout: 32 * time.Second, } if s.h2cEnabled { p := new(http.Protocols) @@ -712,9 +713,10 @@ func (s *Server) getListenerForHTTPSServer(u *url.URL, h http.Handler, t httpLis } httpsServer := http.Server{ - Addr: u.Host, - Handler: h, - TLSConfig: &tlsConfig, + Addr: u.Host, + Handler: h, + TLSConfig: &tlsConfig, + ReadHeaderTimeout: 32 * time.Second, } l := newHTTPListener(&httpsServer, t) @@ -739,7 +741,10 @@ func (s *Server) getListenerForUNIXSocket(u *url.URL, h http.Handler, t httpList os.Remove(socketPath) } - domainSocketServer := http.Server{Handler: h} + domainSocketServer := http.Server{ + Handler: h, + ReadHeaderTimeout: 32 * time.Second, + } if s.h2cEnabled { p := new(http.Protocols) p.SetHTTP1(true)