Skip to content

Commit 6c7c1d7

Browse files
authored
Merge pull request #1695 from vincepri/runnable-group
⚠️ Refactor manager to avoid race conditions and provide clean shutdown
2 parents 0a3dd2a + 612e9b2 commit 6c7c1d7

File tree

8 files changed

+772
-301
lines changed

8 files changed

+772
-301
lines changed

pkg/internal/httpserver/server.go

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
package httpserver
2+
3+
import (
4+
"net/http"
5+
"time"
6+
)
7+
8+
// New returns a new server with sane defaults.
9+
func New(handler http.Handler) *http.Server {
10+
return &http.Server{
11+
Handler: handler,
12+
MaxHeaderBytes: 1 << 20,
13+
IdleTimeout: 90 * time.Second, // matches http.DefaultTransport keep-alive timeout
14+
ReadHeaderTimeout: 32 * time.Second,
15+
}
16+
}

0 commit comments

Comments
 (0)