Skip to content

Commit 952452a

Browse files
committed
Do not set http.Server.WriteTimeout in StartConfig this is bad for SSE and static file serving
1 parent 18ef357 commit 952452a

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

server.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -111,8 +111,8 @@ func (sc StartConfig) start(ctx stdContext.Context, h http.Handler) error {
111111
// G112 (CWE-400): Potential Slowloris Attack because ReadHeaderTimeout is not configured in the http.Server
112112
ReadTimeout: 30 * time.Second,
113113
// WriteTimeout is a max time allowed to write the response
114-
// IMPORTANT: set this to 0 when using Server-Sent-Events (SSE)
115-
WriteTimeout: 30 * time.Second,
114+
// IMPORTANT: set this to 0 when using Server-Sent-Events (SSE) or some larger duration when serving static files
115+
// WriteTimeout: 30 * time.Second,
116116
}
117117

118118
listener := sc.Listener

0 commit comments

Comments
 (0)