caddy/modules/caddyhttp/encode
Muhammad Syafri, S.Kom 03e08ee6a9
encode: prioritize zstd and br over gzip in content negotiation (#7772)
* fix(encode): prioritize zstd and br over gzip in content negotiation

* test(encode): update unit tests to reflect new default priority ties

* fix(encode): move default preferences to dynamic encode handler and restore generic negotiation helper

* test(encode): call real Provision function in served-response test

* test(encode): rename served-response test to TestServeHTTPDefaultEncodingPreference

* refactor(encode): use slices.SortStableFunc and httptest.NewRecorder as recommended

* refactor(encode): simplify sorting with cmp.Compare and check request error in test

* test(encode): fix variable redeclaration in TestServeHTTPDefaultEncodingPreference

Fix 'no new variables on left side of :=' error by changing 'err :=' to 'err ='
on line 347, since err was already declared on line 332.

This fixes the build failure in the encode module tests.
2026-05-29 05:26:19 +10:00
..
brotli
gzip caddyfile: Normalize & flatten all unmarshalers (#6037) 2024-01-23 19:36:59 -05:00
zstd encode: make zstd checksum configurable (#7586) 2026-03-28 13:07:21 -06:00
caddyfile.go encode: make zstd checksum configurable (#7586) 2026-03-28 13:07:21 -06:00
encode.go encode: prioritize zstd and br over gzip in content negotiation (#7772) 2026-05-29 05:26:19 +10:00
encode_test.go encode: prioritize zstd and br over gzip in content negotiation (#7772) 2026-05-29 05:26:19 +10:00