add header for http health check

This commit is contained in:
Kaive Young 2024-03-20 10:52:09 +08:00
parent bb7d51b0db
commit adb4d3d33d
No known key found for this signature in database
GPG Key ID: 6270A77955E33D09
3 changed files with 3 additions and 3 deletions

View File

@ -74,7 +74,7 @@ func NewMonitor(ctx context.Context, cfg v1.HealthCheckConfig, addr string,
url = s + cfg.Path url = s + cfg.Path
} }
header := make(http.Header) header := make(http.Header)
for _, h := range cfg.Headers { for _, h := range cfg.HTTPHeaders {
header.Set(h.Name, h.Value) header.Set(h.Name, h.Value)
} }

View File

@ -217,7 +217,7 @@ healthCheck.intervalSeconds = 10
healthCheck.maxFailed = 3 healthCheck.maxFailed = 3
healthCheck.timeoutSeconds = 3 healthCheck.timeoutSeconds = 3
# set health check headers # set health check headers
healthCheck.headers=[ healthCheck.httpheaders=[
{ name = "x-from-where", value = "frp" } { name = "x-from-where", value = "frp" }
] ]

View File

@ -99,7 +99,7 @@ type HealthCheckConfig struct {
Path string `json:"path,omitempty"` Path string `json:"path,omitempty"`
// Headers specifies the headers to send health checks to if the // Headers specifies the headers to send health checks to if the
// health check type is "http". // health check type is "http".
Headers []HTTPHeader `json:"headers,omitempty"` HTTPHeaders []HTTPHeader `json:"httpHeaders,omitempty"`
} }
type DomainConfig struct { type DomainConfig struct {