Skip to content

Commit

Permalink
fixed bug in resolving ip version in dynamic upstreams
Browse files Browse the repository at this point in the history
  • Loading branch information
armadi1809 committed Jul 9, 2024
1 parent 9338741 commit cc10b08
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions modules/caddyhttp/reverseproxy/upstreams.go
Original file line number Diff line number Diff line change
Expand Up @@ -313,8 +313,8 @@ func (au *AUpstreams) Provision(ctx caddy.Context) error {
func (au AUpstreams) GetUpstreams(r *http.Request) ([]*Upstream, error) {
repl := r.Context().Value(caddy.ReplacerCtxKey).(*caddy.Replacer)

resolveIpv4 := au.Versions == nil || au.Versions.IPv4 == nil || *au.Versions.IPv4
resolveIpv6 := au.Versions == nil || au.Versions.IPv6 == nil || *au.Versions.IPv6
resolveIpv4 := au.Versions == nil || (au.Versions.IPv4 == nil && au.Versions.IPv6 == nil) || (au.Versions.IPv6 != nil && *au.Versions.IPv4)
resolveIpv6 := au.Versions == nil || (au.Versions.IPv6 == nil && au.Versions.IPv4 == nil) || (au.Versions.IPv6 != nil && *au.Versions.IPv6)

// Map ipVersion early, so we can use it as part of the cache-key.
// This should be fairly inexpensive and comes and the upside of
Expand Down

0 comments on commit cc10b08

Please # to comment.