Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Add note about http.Server.WriteTimeout and SSE connection
  • Loading branch information
aldas committed Mar 31, 2026
commit 18ef3574104ff8fd9fea3136c6b2e9d5a9055452
4 changes: 3 additions & 1 deletion server.go
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,9 @@ func (sc StartConfig) start(ctx stdContext.Context, h http.Handler) error {
ErrorLog: slog.NewLogLogger(logger.Handler(), slog.LevelError),
// defaults for GoSec rule G112 // https://github.com/securego/gosec
// G112 (CWE-400): Potential Slowloris Attack because ReadHeaderTimeout is not configured in the http.Server
ReadTimeout: 30 * time.Second,
ReadTimeout: 30 * time.Second,
// WriteTimeout is a max time allowed to write the response
// IMPORTANT: set this to 0 when using Server-Sent-Events (SSE)
WriteTimeout: 30 * time.Second,
}

Expand Down
Loading