Skip to content

Agent Mesh

add timeouts to http server

Antonio Ojea50ba85206c48
diff --git a/cmd/sam-hub/main.go b/cmd/sam-hub/main.go
index 399dcdac..86206b95 100644
--- a/cmd/sam-hub/main.go
+++ b/cmd/sam-hub/main.go
@@ -661,8 +661,12 @@ func main() {
})
server := &http.Server{
- Addr: bindAddress,
- Handler: mux,
+ Addr: bindAddress,
+ Handler: mux,
+ ReadHeaderTimeout: 5 * time.Second,
+ ReadTimeout: 10 * time.Second,
+ WriteTimeout: 10 * time.Second,
+ IdleTimeout: 120 * time.Second,
}
go func() {