0
Fork 0
mirror of https://github.com/caddyserver/caddy.git synced 2025-02-24 23:57:05 -05:00

httpcaddyfile: Sort catch-all site blocks properly (fix )

This commit is contained in:
Matthew Holt 2021-02-01 11:45:28 -07:00
parent e2940c8c03
commit 55e49ff5c8
No known key found for this signature in database
GPG key ID: 2A349DD577D586A5

View file

@ -430,9 +430,12 @@ func (st *ServerType) serversFromPairings(
jLongestPath = addr.Path
}
}
// catch-all blocks (blocks with no hostname) should always go
// last, even after blocks with wildcard hosts
if specificity(iLongestHost) == 0 {
return false
}
if specificity(jLongestHost) == 0 {
// catch-all blocks (blocks with no hostname) should always go
// last, even after blocks with wildcard hosts
return true
}
if iWildcardHost != jWildcardHost {