From 02d5294a31d04531f8f7c82c91aba2d954411d05 Mon Sep 17 00:00:00 2001 From: Olaoluwa Osuntokun Date: Thu, 16 Nov 2023 16:37:12 -0800 Subject: [PATCH] aperture: start setting default values for the http timeout configs In this commit, we start to set default values for the HTTP timeout config values. Otherwise, it's possible that TCP connections will never be closed, causing them to stack up over time, eventually consuming a lot of memory. --- aperture.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/aperture.go b/aperture.go index 95a3193..95fd766 100644 --- a/aperture.go +++ b/aperture.go @@ -381,9 +381,9 @@ func (a *Aperture) Start(errChan chan error) error { a.httpsServer = &http.Server{ Addr: a.cfg.ListenAddr, Handler: handler, - IdleTimeout: 0, - ReadTimeout: 0, - WriteTimeout: 0, + IdleTimeout: time.Minute * 2, + ReadTimeout: time.Second * 15, + WriteTimeout: time.Second * 30, } // Create TLS configuration by either creating new self-signed certs or