HTTP服务增加ReadHeaderTimeout默认值

This commit is contained in:
GoEdgeLab
2020-11-22 11:52:29 +08:00
parent d77749b0cd
commit 4815f378aa

View File

@@ -33,9 +33,10 @@ func (this *HTTPListener) Serve() error {
this.isHTTPS = this.Group.IsHTTPS()
this.httpServer = &http.Server{
Addr: this.addr,
Handler: handler,
IdleTimeout: 2 * time.Minute, // TODO IdleTimeout可以
Addr: this.addr,
Handler: handler,
ReadHeaderTimeout: 3 * time.Second, // TODO 改成可以
IdleTimeout: 2 * time.Minute, // TODO 改成可以配置
ConnState: func(conn net.Conn, state http.ConnState) {
switch state {
case http.StateNew: