Skip to content

Commit

Permalink
Add ReadTimeout and WriteTimeout to HTTP server (#24)
Browse files Browse the repository at this point in the history
  • Loading branch information
lucasrod16 authored Oct 6, 2024
2 parents 1746ad7 + c6c3650 commit 1a926e0
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,10 @@ func main() {
limitedMux := rl.Limit(mux)

server := &http.Server{
Addr: "0.0.0.0:8080",
Handler: limitedMux,
Addr: "0.0.0.0:8080",
Handler: limitedMux,
ReadTimeout: 5 * time.Second,
WriteTimeout: 5 * time.Second,
}

shutdown := make(chan os.Signal, 1)
Expand Down

0 comments on commit 1a926e0

Please sign in to comment.