Browse Source

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

master
Matthew Holt 4 years ago
parent
commit
55e49ff5c8
No known key found for this signature in database GPG Key ID: 2A349DD577D586A5
  1. 5
      caddyconfig/httpcaddyfile/httptype.go

5
caddyconfig/httpcaddyfile/httptype.go

@ -430,9 +430,12 @@ func (st *ServerType) serversFromPairings(
jLongestPath = addr.Path
}
}
if specificity(jLongestHost) == 0 {
// 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 {
return true
}
if iWildcardHost != jWildcardHost {

Loading…
Cancel
Save