Skip to content

fix: 60s read header timeout on debugger #290

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 23, 2025
Merged
Changes from all commits
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
15 changes: 9 additions & 6 deletions cmd/cdnsd/main.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2024 Blink Labs Software
// Copyright 2025 Blink Labs Software
//
// Use of this source code is governed by an MIT-style
// license that can be found in the LICENSE file or at
Expand All @@ -11,10 +11,12 @@ import (
"fmt"
"log/slog"
"net/http"
_ "net/http/pprof"
"os"
"time"

// #nosec G108
_ "net/http/pprof"

"github.com/prometheus/client_golang/prometheus/promhttp"
"go.uber.org/automaxprocs/maxprocs"

Expand Down Expand Up @@ -85,14 +87,15 @@ func main() {
),
)
go func() {
err := http.ListenAndServe(
fmt.Sprintf(
debugger := &http.Server{
Addr: fmt.Sprintf(
"%s:%d",
cfg.Debug.ListenAddress,
cfg.Debug.ListenPort,
),
nil,
)
ReadHeaderTimeout: 60 * time.Second,
}
err := debugger.ListenAndServe()
if err != nil {
slog.Error(
fmt.Sprintf("failed to start debug listener: %s", err),
Expand Down