add read header timeout to http servers

This commit is contained in:
Joel Wetzell
2026-05-17 10:03:48 -05:00
parent ad4aa91e08
commit 9125b323ff
2 changed files with 7 additions and 4 deletions
+3 -2
View File
@@ -53,8 +53,9 @@ func (as *ApiServer) Start(config config.ApiConfig) {
as.serverMu.Lock()
defer as.serverMu.Unlock()
as.server = &http.Server{
Addr: fmt.Sprintf(":%d", as.config.Port),
Handler: mux,
Addr: fmt.Sprintf(":%d", as.config.Port),
ReadHeaderTimeout: 5 * time.Second,
Handler: mux,
}
go func() {