From 62ad389309875b74c32771238e929aa518a3f96a Mon Sep 17 00:00:00 2001 From: Jakub Jarosz Date: Fri, 22 Mar 2024 21:23:48 +0000 Subject: [PATCH] Add timeouts to the server --- hpot.go | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/hpot.go b/hpot.go index f1c3175..73bfd9a 100644 --- a/hpot.go +++ b/hpot.go @@ -9,6 +9,7 @@ import ( "strconv" "strings" "sync" + "time" ) // Pot represents a Honeypot. @@ -52,8 +53,10 @@ func (p *Pot) ListenAndServe() error { }) s := &http.Server{ - Addr: fmt.Sprintf(":%d", p.AdminPort), - Handler: mux, + Addr: fmt.Sprintf(":%d", p.AdminPort), + ReadTimeout: 10 * time.Second, + WriteTimeout: 10 * time.Second, + Handler: mux, } go func() {