From 1e18afb5c862d62be130d563785de5c58f08ae8e Mon Sep 17 00:00:00 2001 From: Matthew Holt Date: Mon, 25 Jul 2022 17:28:20 -0600 Subject: httpcaddyfile: Detect ambiguous site definitions (fix #4635) Previously, our "duplicate key in server block" logic was flawed because it did not account for the site's bind address. We defer this check to when the listener addresses have been assigned, but before we commit a server block to its listener. Also refined how network address parsing and joining works, which was necessary for a less convoluted fix. --- caddytest/integration/caddyfile_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'caddytest') diff --git a/caddytest/integration/caddyfile_test.go b/caddytest/integration/caddyfile_test.go index be85f4a..2758883 100644 --- a/caddytest/integration/caddyfile_test.go +++ b/caddytest/integration/caddyfile_test.go @@ -68,7 +68,7 @@ func TestDuplicateHosts(t *testing.T) { } `, "caddyfile", - "duplicate site address not allowed") + "ambiguous site definition") } func TestReadCookie(t *testing.T) { -- cgit v1.2.3