1
Fork 0
mirror of https://github.com/caddyserver/caddy.git synced 2024-12-16 21:56:40 -05:00

httpcaddyfile: Sort TLS SNI matcher for deterministic JSON output (#5860)

* httpcaddyfile: Sort TLS SNI matcher, for deterministic adapt output

* Update caddyconfig/httpcaddyfile/httptype.go

---------

Co-authored-by: Matt Holt <mholt@users.noreply.github.com>
This commit is contained in:
Francis Lavoie 2023-10-11 11:47:07 -04:00 committed by GitHub
parent 9c419f1e1a
commit 33d8d2c6b5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -685,6 +685,7 @@ func (st *ServerType) serversFromPairings(
}
if len(hosts) > 0 {
slices.Sort(hosts) // for deterministic JSON output
cp.MatchersRaw = caddy.ModuleMap{
"sni": caddyconfig.JSON(hosts, warnings), // make sure to match all hosts, not just auto-HTTPS-qualified ones
}