summaryrefslogtreecommitdiff
path: root/modules/caddyhttp/reverseproxy
diff options
context:
space:
mode:
authorFrancis Lavoie <lavofr@gmail.com>2023-05-03 13:07:22 -0400
committerGitHub <noreply@github.com>2023-05-03 17:07:22 +0000
commit3f20a7c9f348122d5fae7074b9fa17651189bb9a (patch)
tree138182ce81eb94eccab71c28528ecf0c7b8e0712 /modules/caddyhttp/reverseproxy
parent1af419e7eca0c7b8559ec2f3b397f948f1ef13c2 (diff)
acmeserver: Configurable `resolvers`, fix smallstep deprecations (#5500)
* acmeserver: Configurable `resolvers`, fix smallstep deprecations * Improve default net/port * Update proxy resolvers parsing to use the new function * Update listeners.go Co-authored-by: itsxaos <33079230+itsxaos@users.noreply.github.com> --------- Co-authored-by: itsxaos <33079230+itsxaos@users.noreply.github.com>
Diffstat (limited to 'modules/caddyhttp/reverseproxy')
-rw-r--r--modules/caddyhttp/reverseproxy/upstreams.go12
1 files changed, 2 insertions, 10 deletions
diff --git a/modules/caddyhttp/reverseproxy/upstreams.go b/modules/caddyhttp/reverseproxy/upstreams.go
index 30bd7b5..42fedb6 100644
--- a/modules/caddyhttp/reverseproxy/upstreams.go
+++ b/modules/caddyhttp/reverseproxy/upstreams.go
@@ -8,7 +8,6 @@ import (
"net"
"net/http"
"strconv"
- "strings"
"sync"
"time"
@@ -471,16 +470,9 @@ type UpstreamResolver struct {
// and ensures they're ready to be used.
func (u *UpstreamResolver) ParseAddresses() error {
for _, v := range u.Addresses {
- addr, err := caddy.ParseNetworkAddress(v)
+ addr, err := caddy.ParseNetworkAddressWithDefaults(v, "udp", 53)
if err != nil {
- // If a port wasn't specified for the resolver,
- // try defaulting to 53 and parse again
- if strings.Contains(err.Error(), "missing port in address") {
- addr, err = caddy.ParseNetworkAddress(v + ":53")
- }
- if err != nil {
- return err
- }
+ return err
}
if addr.PortRangeSize() != 1 {
return fmt.Errorf("resolver address must have exactly one address; cannot call %v", addr)