summaryrefslogtreecommitdiffhomepage
path: root/caddyconfig
diff options
context:
space:
mode:
authorFrancis Lavoie <[email protected]>2023-12-18 14:54:52 -0500
committerGitHub <[email protected]>2023-12-18 12:54:52 -0700
commitda7d8cb26d97d8b797732cc0dcb697edffb693cd (patch)
tree8b9167b392f20b09af06568008ef2641adf201b9 /caddyconfig
parent387545a895ea71ae9f4f4e512dca136f92e45a74 (diff)
downloadcaddy-da7d8cb26d97d8b797732cc0dcb697edffb693cd.tar.gz
caddy-da7d8cb26d97d8b797732cc0dcb697edffb693cd.zip
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 <[email protected]> * Fix test * Bah --------- Co-authored-by: Mohammed Al Sahaf <[email protected]>
Diffstat (limited to 'caddyconfig')
-rw-r--r--caddyconfig/httpcaddyfile/httptype.go5
1 files changed, 5 insertions, 0 deletions
diff --git a/caddyconfig/httpcaddyfile/httptype.go b/caddyconfig/httpcaddyfile/httptype.go
index c82d92efc..cb3095a16 100644
--- a/caddyconfig/httpcaddyfile/httptype.go
+++ b/caddyconfig/httpcaddyfile/httptype.go
@@ -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)