diff options
author | Francis Lavoie <[email protected]> | 2023-12-18 14:54:52 -0500 |
---|---|---|
committer | GitHub <[email protected]> | 2023-12-18 12:54:52 -0700 |
commit | da7d8cb26d97d8b797732cc0dcb697edffb693cd (patch) | |
tree | 8b9167b392f20b09af06568008ef2641adf201b9 /caddyconfig | |
parent | 387545a895ea71ae9f4f4e512dca136f92e45a74 (diff) | |
download | caddy-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.go | 5 |
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) |