mirror of
https://github.com/caddyserver/caddy.git
synced 2024-11-22 08:04:02 +08:00
httpcaddyfile: Sort skip_hosts for deterministic JSON (#5990)
* httpcaddyfile: Sort skip_hosts for deterministic JSON * Update caddyconfig/httpcaddyfile/httptype.go Co-authored-by: Mohammed Al Sahaf <msaa1990@gmail.com> * Fix test * Bah --------- Co-authored-by: Mohammed Al Sahaf <msaa1990@gmail.com>
This commit is contained in:
parent
387545a895
commit
da7d8cb26d
|
@ -820,6 +820,11 @@ func (st *ServerType) serversFromPairings(
|
|||
}
|
||||
}
|
||||
|
||||
// sort for deterministic JSON output
|
||||
if srv.Logs != nil {
|
||||
slices.Sort(srv.Logs.SkipHosts)
|
||||
}
|
||||
|
||||
// a server cannot (natively) serve both HTTP and HTTPS at the
|
||||
// same time, so make sure the configuration isn't in conflict
|
||||
err := detectConflictingSchemes(srv, p.serverBlocks, options)
|
||||
|
|
|
@ -66,9 +66,9 @@ example.com {
|
|||
"one.example.com": ""
|
||||
},
|
||||
"skip_hosts": [
|
||||
"example.com",
|
||||
"three.example.com",
|
||||
"two.example.com",
|
||||
"example.com"
|
||||
"two.example.com"
|
||||
]
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user