From cb09020b0d40bdc47749e5b604fee28c6d53eea1 Mon Sep 17 00:00:00 2001 From: Stephen Adamson Date: Fri, 10 Jul 2026 12:08:08 +0100 Subject: [PATCH] fix: add http.Server timeouts to mitigate Slowloris (G112) --- backend/main.go | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/backend/main.go b/backend/main.go index 910b202..1630b5d 100644 --- a/backend/main.go +++ b/backend/main.go @@ -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)