Skip to content

Commit

Permalink
Add ReadHeaderTimeout to http.Server (#283)
Browse files Browse the repository at this point in the history
  • Loading branch information
lucacome authored Jul 21, 2022
1 parent e74d8da commit f452ae5
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion exporter.go
Original file line number Diff line number Diff line change
Expand Up @@ -381,7 +381,9 @@ func main() {
Transport: userAgentRT,
}

srv := http.Server{}
srv := http.Server{
ReadHeaderTimeout: 5 * time.Second,
}

signalChan := make(chan os.Signal, 1)
signal.Notify(signalChan, os.Interrupt, syscall.SIGTERM)
Expand Down

0 comments on commit f452ae5

Please sign in to comment.