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 LavoieandMatt Holt authored and GitHub committed 2023-10-11 09:47:07 -06:00
1 parent 9c419f1e1a
commit 33d8d2c6b5
1 file changed
+1
+1
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
}