File tree Expand file tree Collapse file tree 1 file changed +9
-6
lines changed Expand file tree Collapse file tree 1 file changed +9
-6
lines changed Original file line number Diff line number Diff line change 1
- // Copyright 2024 Blink Labs Software
1
+ // Copyright 2025 Blink Labs Software
2
2
//
3
3
// Use of this source code is governed by an MIT-style
4
4
// license that can be found in the LICENSE file or at
@@ -11,10 +11,12 @@ import (
11
11
"fmt"
12
12
"log/slog"
13
13
"net/http"
14
- _ "net/http/pprof"
15
14
"os"
16
15
"time"
17
16
17
+ // #nosec G108
18
+ _ "net/http/pprof"
19
+
18
20
"github.com/prometheus/client_golang/prometheus/promhttp"
19
21
"go.uber.org/automaxprocs/maxprocs"
20
22
@@ -85,14 +87,15 @@ func main() {
85
87
),
86
88
)
87
89
go func () {
88
- err := http .ListenAndServe (
89
- fmt .Sprintf (
90
+ debugger := & http.Server {
91
+ Addr : fmt .Sprintf (
90
92
"%s:%d" ,
91
93
cfg .Debug .ListenAddress ,
92
94
cfg .Debug .ListenPort ,
93
95
),
94
- nil ,
95
- )
96
+ ReadHeaderTimeout : 60 * time .Second ,
97
+ }
98
+ err := debugger .ListenAndServe ()
96
99
if err != nil {
97
100
slog .Error (
98
101
fmt .Sprintf ("failed to start debug listener: %s" , err ),
You can’t perform that action at this time.
0 commit comments