aboutsummaryrefslogtreecommitdiffhomepage
path: root/caddyconfig/httpcaddyfile/addresses.go
diff options
context:
space:
mode:
authorAaron Paterson <[email protected]>2024-10-21 10:02:29 -0400
committerGitHub <[email protected]>2024-10-21 08:02:29 -0600
commit0182fb87fa7276463086c2360431a1c0dc797edf (patch)
tree2b5f3d5e3aa8bcd1a994da82d8eeb1cb45488365 /caddyconfig/httpcaddyfile/addresses.go
parent1391e8ed9ae16e233c904b31fe4da2d687149820 (diff)
downloadcaddy-0182fb87fa7276463086c2360431a1c0dc797edf.tar.gz
caddy-0182fb87fa7276463086c2360431a1c0dc797edf.zip
core: addresses.go funcs renames (#6622)
* right side in tls ln * remove ParseNetworkAddressFromHostPort * ignore placeholder port * remove println * update test cases (!!!) * [] * comment * Trim * Update addresses.go
Diffstat (limited to 'caddyconfig/httpcaddyfile/addresses.go')
-rw-r--r--caddyconfig/httpcaddyfile/addresses.go8
1 files changed, 6 insertions, 2 deletions
diff --git a/caddyconfig/httpcaddyfile/addresses.go b/caddyconfig/httpcaddyfile/addresses.go
index c9057ab4e..1121776d9 100644
--- a/caddyconfig/httpcaddyfile/addresses.go
+++ b/caddyconfig/httpcaddyfile/addresses.go
@@ -329,8 +329,12 @@ func (st *ServerType) listenersForServerBlockAddress(sblock serverBlock, addr Ad
// use a map to prevent duplication
listeners := map[string]map[string]struct{}{}
for _, lnCfgVal := range lnCfgVals {
- for _, lnHost := range lnCfgVal.addresses {
- networkAddr, err := caddy.ParseNetworkAddressFromHostPort(lnHost, lnPort)
+ for _, lnAddr := range lnCfgVal.addresses {
+ lnNetw, lnHost, _, err := caddy.SplitNetworkAddress(lnAddr)
+ if err != nil {
+ return nil, fmt.Errorf("splitting listener address: %v", err)
+ }
+ networkAddr, err := caddy.ParseNetworkAddress(caddy.JoinNetworkAddress(lnNetw, lnHost, lnPort))
if err != nil {
return nil, fmt.Errorf("parsing network address: %v", err)
}