From b4418dec0584d0c557ef8fd512f484e57bac0e37 Mon Sep 17 00:00:00 2001 From: Dominic Couture Date: Mon, 2 Dec 2024 11:37:40 +0000 Subject: [PATCH] Fix Vulnerability - Uncontrolled resource consumption (Slowloris) [ci skip] --- internal/git/gittest/http_server.go | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/internal/git/gittest/http_server.go b/internal/git/gittest/http_server.go index fe48604e3d..bbe984dd03 100644 --- a/internal/git/gittest/http_server.go +++ b/internal/git/gittest/http_server.go @@ -38,7 +38,12 @@ func HTTPServer(tb testing.TB, ctx context.Context, gitCmdFactory gitcmd.Command }, gitExecEnv.EnvironmentVariables...), } - s := &http.Server{Handler: gitHTTPBackend} + s := &http.Server{ + Handler: gitHTTPBackend, + ReadTimeout: 10 * time.Second, + WriteTimeout: 10 * time.Second, + IdleTimeout: 120 * time.Second, + } tb.Cleanup(func() { testhelper.MustClose(tb, s) }) @@ -53,3 +58,4 @@ func HTTPServer(tb testing.TB, ctx context.Context, gitCmdFactory gitcmd.Command return listener.Addr().(*net.TCPAddr).Port } + -- GitLab