Skip to content

Commit

Permalink
fix potential Slowloris vulnerability
Browse files Browse the repository at this point in the history
  • Loading branch information
w3irdrobot committed Jun 16, 2023
1 parent bb454ee commit 5b104a4
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ import (
)

const (
shutdownTimeout = 5 * time.Second
shutdownTimeout = 5 * time.Second
readHeaderTimeout = 20 * time.Second
)

func main() {
Expand All @@ -22,7 +23,11 @@ func main() {
}

router := http.NewServeMux()
server := &http.Server{Addr: cfg.address, Handler: router}
server := &http.Server{
Addr: cfg.address,
Handler: router,
ReadHeaderTimeout: readHeaderTimeout,
}
appCtx, appCancel := context.WithCancel(context.Background())

router.Handle("/", newHandler(appCtx, cfg.webhookSecret, cfg.nodeAPI, cfg.walletPassword))
Expand Down

0 comments on commit 5b104a4

Please sign in to comment.