mirror of
https://github.com/caddyserver/caddy.git
synced 2025-02-13 03:26:37 +01:00
httpcaddyfile: Sort catch-all site blocks properly (fix #4003)
This commit is contained in:
parent
e2940c8c03
commit
55e49ff5c8
1 changed files with 5 additions and 2 deletions
|
@ -430,9 +430,12 @@ func (st *ServerType) serversFromPairings(
|
||||||
jLongestPath = addr.Path
|
jLongestPath = addr.Path
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if specificity(jLongestHost) == 0 {
|
|
||||||
// catch-all blocks (blocks with no hostname) should always go
|
// catch-all blocks (blocks with no hostname) should always go
|
||||||
// last, even after blocks with wildcard hosts
|
// last, even after blocks with wildcard hosts
|
||||||
|
if specificity(iLongestHost) == 0 {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
if specificity(jLongestHost) == 0 {
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
if iWildcardHost != jWildcardHost {
|
if iWildcardHost != jWildcardHost {
|
||||||
|
|
Loading…
Reference in a new issue