Use bit shift for HTTPMaxHeaderBytes constant

This commit is contained in:
2026-01-08 02:26:47 -08:00
parent 31df1a4a03
commit 146eeee070

View File

@@ -8,9 +8,9 @@ import (
// HTTP server configuration constants.
const (
HTTPReadTimeout = 30 * time.Second
HTTPWriteTimeout = 60 * time.Second
HTTPMaxHeaderKB = 8
HTTPReadTimeout = 30 * time.Second
HTTPWriteTimeout = 60 * time.Second
HTTPMaxHeaderBytes = 8 << 10 // 8KB
)
func (s *Server) serveUntilShutdown() {
@@ -19,7 +19,7 @@ func (s *Server) serveUntilShutdown() {
Addr: listenAddr,
ReadTimeout: HTTPReadTimeout,
WriteTimeout: HTTPWriteTimeout,
MaxHeaderBytes: HTTPMaxHeaderKB * 1024,
MaxHeaderBytes: HTTPMaxHeaderBytes,
Handler: s,
}