diff --git a/internal/server/http.go b/internal/server/http.go index f644fe8..edee7ae 100644 --- a/internal/server/http.go +++ b/internal/server/http.go @@ -6,13 +6,20 @@ import ( "time" ) +// HTTP server configuration constants. +const ( + HTTPReadTimeout = 30 * time.Second + HTTPWriteTimeout = 60 * time.Second + HTTPMaxHeaderKB = 8 +) + func (s *Server) serveUntilShutdown() { listenAddr := fmt.Sprintf(":%d", s.config.Port) s.httpServer = &http.Server{ Addr: listenAddr, - ReadTimeout: 30 * time.Second, - WriteTimeout: 60 * time.Second, - MaxHeaderBytes: 1 << 13, // 8KB + ReadTimeout: HTTPReadTimeout, + WriteTimeout: HTTPWriteTimeout, + MaxHeaderBytes: HTTPMaxHeaderKB * 1024, Handler: s, }