Skip to content

Commit

Permalink
transport not exported for active health check
Browse files Browse the repository at this point in the history
  • Loading branch information
ab14-tech committed Jan 24, 2025
1 parent be406bc commit 7a805e8
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions modules/caddyhttp/reverseproxy/healthchecks.go
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,6 @@ type ActiveHealthChecks struct {
// Configures the method of transport for the active health checker.
// The default transport is the handler's transport
TransportRaw json.RawMessage `json:"transport,omitempty" caddy:"namespace=http.reverse_proxy.health_checks.active.transport inline_key=protocol"`
Transport http.RoundTripper `json:"transport,omitempty"`

// HTTP headers to set on health check requests.
Headers http.Header `json:"headers,omitempty"`
Expand Down Expand Up @@ -134,6 +133,7 @@ type ActiveHealthChecks struct {
// body of a healthy backend.
ExpectBody string `json:"expect_body,omitempty"`

transport http.RoundTripper `json:"transport,omitempty"`
uri *url.URL
httpClient *http.Client
bodyRegexp *regexp.Regexp
Expand Down Expand Up @@ -187,14 +187,14 @@ func (a *ActiveHealthChecks) Provision(ctx caddy.Context, h *Handler) error {
if err != nil {
return fmt.Errorf("loading transport: %v", err)
}
a.Transport = mod.(http.RoundTripper)
a.transport = mod.(http.RoundTripper)
} else {
a.Transport = h.Transport
a.transport = h.Transport
}

a.httpClient = &http.Client{
Timeout: timeout,
Transport: a.Transport,
Transport: a.transport,
CheckRedirect: func(req *http.Request, via []*http.Request) error {
if !a.FollowRedirects {
return http.ErrUseLastResponse
Expand Down

0 comments on commit 7a805e8

Please sign in to comment.