Skip to content

Commit

Permalink
fix: add ReadHeaderTimeout to stats server
Browse files Browse the repository at this point in the history
  • Loading branch information
maier committed Nov 14, 2023
1 parent 97d2d07 commit 6d96d7e
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion internal/agent/agent.go
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,10 @@ func New() (*Agent, error) {
a.watchers[idx] = w
}

a.svrHTTP = &http.Server{Addr: net.JoinHostPort("localhost", viper.GetString(config.KeyAppStatPort))}
a.svrHTTP = &http.Server{
Addr: net.JoinHostPort("localhost", viper.GetString(config.KeyAppStatPort)),
ReadHeaderTimeout: 5 * time.Second,
}
a.svrHTTP.SetKeepAlivesEnabled(false)

a.setupSignalHandler()
Expand Down

0 comments on commit 6d96d7e

Please sign in to comment.