From ccab1a346a49d9a6a40cd2c2e8c33bab2a1dda03 Mon Sep 17 00:00:00 2001 From: Livio Spring Date: Wed, 4 Dec 2024 08:13:26 +0100 Subject: [PATCH] add WriteTimeout --- cmd/start/start.go | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/cmd/start/start.go b/cmd/start/start.go index 56abfa2acc..a3bcc5c7c6 100644 --- a/cmd/start/start.go +++ b/cmd/start/start.go @@ -559,13 +559,14 @@ func startAPIs( } type test struct { - IdleTimeout time.Duration - ReadTimeout time.Duration + IdleTimeout time.Duration + ReadTimeout time.Duration + WriteTimeout time.Duration } func listen(ctx context.Context, router *mux.Router, port uint16, tlsConfig *tls.Config, shutdown <-chan os.Signal, test test) error { http2Server := &http2.Server{IdleTimeout: test.IdleTimeout} - http1Server := &http.Server{Handler: h2c.NewHandler(router, http2Server), TLSConfig: tlsConfig, ReadTimeout: test.ReadTimeout, IdleTimeout: test.IdleTimeout} + http1Server := &http.Server{Handler: h2c.NewHandler(router, http2Server), TLSConfig: tlsConfig, ReadTimeout: test.ReadTimeout, IdleTimeout: test.IdleTimeout, WriteTimeout: test.WriteTimeout} lc := net.ListenConfig() lis, err := lc.Listen(ctx, "tcp", fmt.Sprintf(":%d", port))