Skip to content

Commit

Permalink
Set User-Agent on healthcheck requests
Browse files Browse the repository at this point in the history
For a bit of extra clarity in the app logs.
  • Loading branch information
kevinmcconnell committed Nov 25, 2024
1 parent a551fe2 commit 38ceab1
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions internal/server/health_check.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ import (
"time"
)

const (
healthCheckUserAgent = "kamal-proxy"
)

type HealthCheckConsumer interface {
HealthCheckCompleted(success bool)
}
Expand Down Expand Up @@ -69,6 +73,8 @@ func (hc *HealthCheck) check() {
return
}

req.Header.Set("User-Agent", healthCheckUserAgent)

resp, err := http.DefaultClient.Do(req)
if err != nil {
slog.Info("Healthcheck failed", "error", err)
Expand Down

0 comments on commit 38ceab1

Please sign in to comment.