aboutsummaryrefslogtreecommitdiffhomepage
path: root/caddyconfig/httpcaddyfile
diff options
context:
space:
mode:
authorFrancis Lavoie <[email protected]>2023-10-11 11:47:07 -0400
committerGitHub <[email protected]>2023-10-11 09:47:07 -0600
commit33d8d2c6b5e070d108d69853b8d56fb2f89a1f31 (patch)
tree1c9b92c6d3c8a128fb33b14faab7d6e1f8b4552b /caddyconfig/httpcaddyfile
parent9c419f1e1a4a82a8ed49bac3d54050890cb3e58e (diff)
downloadcaddy-33d8d2c6b5e070d108d69853b8d56fb2f89a1f31.tar.gz
caddy-33d8d2c6b5e070d108d69853b8d56fb2f89a1f31.zip
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 <[email protected]>
Diffstat (limited to 'caddyconfig/httpcaddyfile')
-rw-r--r--caddyconfig/httpcaddyfile/httptype.go1
1 files changed, 1 insertions, 0 deletions
diff --git a/caddyconfig/httpcaddyfile/httptype.go b/caddyconfig/httpcaddyfile/httptype.go
index 79442c8f7..3e8fdcac0 100644
--- a/caddyconfig/httpcaddyfile/httptype.go
+++ b/caddyconfig/httpcaddyfile/httptype.go
@@ -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
}