Use bit shift for HTTPMaxHeaderBytes constant
This commit is contained in:
@@ -10,7 +10,7 @@ import (
|
|||||||
const (
|
const (
|
||||||
HTTPReadTimeout = 30 * time.Second
|
HTTPReadTimeout = 30 * time.Second
|
||||||
HTTPWriteTimeout = 60 * time.Second
|
HTTPWriteTimeout = 60 * time.Second
|
||||||
HTTPMaxHeaderKB = 8
|
HTTPMaxHeaderBytes = 8 << 10 // 8KB
|
||||||
)
|
)
|
||||||
|
|
||||||
func (s *Server) serveUntilShutdown() {
|
func (s *Server) serveUntilShutdown() {
|
||||||
@@ -19,7 +19,7 @@ func (s *Server) serveUntilShutdown() {
|
|||||||
Addr: listenAddr,
|
Addr: listenAddr,
|
||||||
ReadTimeout: HTTPReadTimeout,
|
ReadTimeout: HTTPReadTimeout,
|
||||||
WriteTimeout: HTTPWriteTimeout,
|
WriteTimeout: HTTPWriteTimeout,
|
||||||
MaxHeaderBytes: HTTPMaxHeaderKB * 1024,
|
MaxHeaderBytes: HTTPMaxHeaderBytes,
|
||||||
Handler: s,
|
Handler: s,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user