Commit 418c24c0 authored by milgradesec's avatar milgradesec Committed by GitHub

Add timeouts for http server (#3920)

Signed-off-by: default avatarmilgradesec <milgradesec@gmail.com>
parent 011686b3
...@@ -40,7 +40,12 @@ func NewServerHTTPS(addr string, group []*Config) (*ServerHTTPS, error) { ...@@ -40,7 +40,12 @@ func NewServerHTTPS(addr string, group []*Config) (*ServerHTTPS, error) {
tlsConfig = conf.TLSConfig tlsConfig = conf.TLSConfig
} }
sh := &ServerHTTPS{Server: s, tlsConfig: tlsConfig, httpsServer: new(http.Server)} srv := &http.Server{
ReadTimeout: 5 * time.Second,
WriteTimeout: 10 * time.Second,
IdleTimeout: 120 * time.Second,
}
sh := &ServerHTTPS{Server: s, tlsConfig: tlsConfig, httpsServer: srv}
sh.httpsServer.Handler = sh sh.httpsServer.Handler = sh
return sh, nil return sh, nil
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment