From 0bc0079a587f950253927e4618fd1612a7faa3c4 Mon Sep 17 00:00:00 2001 From: Lukasz Raczylo Date: Tue, 19 May 2026 14:18:28 +0100 Subject: [PATCH] refactor(oidcgate): WriteTimeout for slowloris guard, nolint reason --- cmd/oidcgate/server.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/cmd/oidcgate/server.go b/cmd/oidcgate/server.go index fc960c4..05af948 100644 --- a/cmd/oidcgate/server.go +++ b/cmd/oidcgate/server.go @@ -25,17 +25,18 @@ func buildMux(cfg *Config, middleware http.Handler, ready readyReporter) *http.S } // buildServer wraps the mux in an http.Server with sensible timeouts. -func buildServer(cfg *Config, mux http.Handler) *http.Server { //nolint:unused +func buildServer(cfg *Config, mux http.Handler) *http.Server { //nolint:unused // consumed by main.go in Task 9 return &http.Server{ Addr: cfg.Listen, Handler: mux, ReadHeaderTimeout: 10 * time.Second, + WriteTimeout: 30 * time.Second, IdleTimeout: 120 * time.Second, } } // shutdown gracefully stops the server with a 15s deadline. -func shutdown(srv *http.Server) error { //nolint:unused +func shutdown(srv *http.Server) error { //nolint:unused // consumed by main.go in Task 9 ctx, cancel := context.WithTimeout(context.Background(), 15*time.Second) defer cancel() return srv.Shutdown(ctx)