Skip to content

Commit 91fbf36

Browse files
authored
fix: 60s timeout on debugger http server (#308)
Signed-off-by: Chris Gianelloni <wolf31o2@blinklabs.io>
1 parent f57e190 commit 91fbf36

File tree

1 file changed

+10
-6
lines changed

1 file changed

+10
-6
lines changed

cmd/tx-submit-api/main.go

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2023 Blink Labs Software
1+
// Copyright 2025 Blink Labs Software
22
//
33
// Licensed under the Apache License, Version 2.0 (the "License");
44
// you may not use this file except in compliance with the License.
@@ -18,8 +18,11 @@ import (
1818
"flag"
1919
"fmt"
2020
"net/http"
21-
_ "net/http/pprof"
2221
"os"
22+
"time"
23+
24+
// #nosec G108
25+
_ "net/http/pprof"
2326

2427
"go.uber.org/automaxprocs/maxprocs"
2528

@@ -83,14 +86,15 @@ func main() {
8386
cfg.Debug.ListenPort,
8487
)
8588
go func() {
86-
err := http.ListenAndServe(
87-
fmt.Sprintf(
89+
debugger := &http.Server{
90+
Addr: fmt.Sprintf(
8891
"%s:%d",
8992
cfg.Debug.ListenAddress,
9093
cfg.Debug.ListenPort,
9194
),
92-
nil,
93-
)
95+
ReadHeaderTimeout: 60 * time.Second,
96+
}
97+
err := debugger.ListenAndServe()
9498
if err != nil {
9599
logger.Fatalf("failed to start debug listener: %s", err)
96100
}

0 commit comments

Comments
 (0)