mirror of
https://github.com/caddyserver/caddy.git
synced 2025-05-24 03:19:59 +08:00
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.
This commit is contained in:
@ -68,7 +68,7 @@ func TestDuplicateHosts(t *testing.T) {
|
||||
}
|
||||
`,
|
||||
"caddyfile",
|
||||
"duplicate site address not allowed")
|
||||
"ambiguous site definition")
|
||||
}
|
||||
|
||||
func TestReadCookie(t *testing.T) {
|
||||
|
Reference in New Issue
Block a user