diff options
author | Francis Lavoie <lavofr@gmail.com> | 2023-04-10 16:08:40 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-04-10 20:08:40 +0000 |
commit | 4636109ce17e6ba5f46e73b7b1f3ae82d076a625 (patch) | |
tree | 93d9bda1a253a002bcb4b4e4d0daa9a67d1bad79 /modules/caddyhttp/reverseproxy/caddyfile.go | |
parent | 205b142614d5de08ffc33a04ae4cfc00e65b5dfc (diff) |
reverseproxy: Remove deprecated `lookup_srv` (#5396)
Diffstat (limited to 'modules/caddyhttp/reverseproxy/caddyfile.go')
-rw-r--r-- | modules/caddyhttp/reverseproxy/caddyfile.go | 19 |
1 files changed, 2 insertions, 17 deletions
diff --git a/modules/caddyhttp/reverseproxy/caddyfile.go b/modules/caddyhttp/reverseproxy/caddyfile.go index fab3099..fc8eed6 100644 --- a/modules/caddyhttp/reverseproxy/caddyfile.go +++ b/modules/caddyhttp/reverseproxy/caddyfile.go @@ -15,7 +15,6 @@ package reverseproxy import ( - "net" "net/http" "reflect" "strconv" @@ -142,15 +141,8 @@ func (h *Handler) UnmarshalCaddyfile(d *caddyfile.Dispenser) error { h.responseMatchers = make(map[string]caddyhttp.ResponseMatcher) // appendUpstream creates an upstream for address and adds - // it to the list. If the address starts with "srv+" it is - // treated as a SRV-based upstream, and any port will be - // dropped. + // it to the list. appendUpstream := func(address string) error { - isSRV := strings.HasPrefix(address, "srv+") - if isSRV { - address = strings.TrimPrefix(address, "srv+") - } - dialAddr, scheme, err := parseUpstreamDialAddress(address) if err != nil { return d.WrapErr(err) @@ -165,14 +157,7 @@ func (h *Handler) UnmarshalCaddyfile(d *caddyfile.Dispenser) error { } commonScheme = scheme - if isSRV { - if host, _, err := net.SplitHostPort(dialAddr); err == nil { - dialAddr = host - } - h.Upstreams = append(h.Upstreams, &Upstream{LookupSRV: dialAddr}) - } else { - h.Upstreams = append(h.Upstreams, &Upstream{Dial: dialAddr}) - } + h.Upstreams = append(h.Upstreams, &Upstream{Dial: dialAddr}) return nil } |