Commit d9aba6b3 authored by Janoš Guljaš's avatar Janoš Guljaš Committed by GitHub

set http server timeouts (#869)

parent db8edb53
...@@ -423,8 +423,10 @@ func NewBee(addr string, swarmAddress swarm.Address, publicKey ecdsa.PublicKey, ...@@ -423,8 +423,10 @@ func NewBee(addr string, swarmAddress swarm.Address, publicKey ecdsa.PublicKey,
} }
apiServer := &http.Server{ apiServer := &http.Server{
Handler: apiService, IdleTimeout: 30 * time.Second,
ErrorLog: log.New(b.errorLogWriter, "", 0), ReadHeaderTimeout: 3 * time.Second,
Handler: apiService,
ErrorLog: log.New(b.errorLogWriter, "", 0),
} }
go func() { go func() {
...@@ -475,8 +477,10 @@ func NewBee(addr string, swarmAddress swarm.Address, publicKey ecdsa.PublicKey, ...@@ -475,8 +477,10 @@ func NewBee(addr string, swarmAddress swarm.Address, publicKey ecdsa.PublicKey,
} }
debugAPIServer := &http.Server{ debugAPIServer := &http.Server{
Handler: debugAPIService, IdleTimeout: 30 * time.Second,
ErrorLog: log.New(b.errorLogWriter, "", 0), ReadHeaderTimeout: 3 * time.Second,
Handler: debugAPIService,
ErrorLog: log.New(b.errorLogWriter, "", 0),
} }
go func() { go func() {
......
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