fix: add http.Server timeouts to mitigate Slowloris (G112)

This commit is contained in:
2026-07-10 12:08:08 +01:00
parent 6599ef85fd
commit cb09020b0d
+6 -2
View File
@@ -502,8 +502,12 @@ func main() {
r.Post("/webhooks/square", webhooks.HandleSquareWebhook)
srv := &http.Server{
Addr: ":8080",
Handler: r,
Addr: ":8080",
Handler: r,
ReadHeaderTimeout: 10 * time.Second,
ReadTimeout: 30 * time.Second,
WriteTimeout: 30 * time.Second,
IdleTimeout: 60 * time.Second,
}
quit := make(chan os.Signal, 1)