From 9ea2efc3bd894546aef94a0ff8ae7f4deddbacf6 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 b45ed85..f3ed9e1 100644 --- a/aperture.go +++ b/aperture.go @@ -379,9 +379,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