From af7bf8865d3c800760daea72dbd2b28b4c25056e Mon Sep 17 00:00:00 2001
From: ale <ale@incal.net>
Date: Mon, 13 Sep 2021 18:34:33 +0100
Subject: [PATCH] Drop WriteTimeout on the default http.Server

It was acting as an upper limit for the request lifetime, which isn't
necessary on internal services.
---
 serverutil/http.go | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/serverutil/http.go b/serverutil/http.go
index 692ec5b..3975b21 100644
--- a/serverutil/http.go
+++ b/serverutil/http.go
@@ -72,11 +72,10 @@ func (config *ServerConfig) buildHTTPServer(h http.Handler) (*http.Server, error
 	// can be generous with the timeouts to keep the number of
 	// reconnections low.
 	return &http.Server{
-		Handler:      addDefaultHandlers(h),
-		ReadTimeout:  30 * time.Second,
-		WriteTimeout: 30 * time.Second,
-		IdleTimeout:  600 * time.Second,
-		TLSConfig:    tlsConfig,
+		Handler:           addDefaultHandlers(h),
+		ReadHeaderTimeout: 30 * time.Second,
+		IdleTimeout:       600 * time.Second,
+		TLSConfig:         tlsConfig,
 	}, nil
 }
 
-- 
GitLab