caddy/modules/caddyhttp/encode
Jay Hemnani 093fd4b7ec
encode: Don't write an empty encoded stream for HEAD responses (#8150)
* encode: Don't write an empty encoded stream for HEAD responses

When nothing was written (e.g. a HEAD request), Close() still closed the
encoder, which wrote the empty stream trailer to the client. The server
then set Content-Length to that size (20 for gzip, 13 for zstd) instead
of omitting it as for the matching GET response.

* encode: Check resp.ContentLength in the HEAD test

* encode: Track body writes to decide whether to close the encoder
2026-10-09 18:14:56 +10:00
..
brotli
…
gzip
…
testdata encode: add standard benchmark and conformance harness (#7804) 2026-06-11 17:55:18 -06:00
zstd encode: make zstd checksum configurable (#7586) 2026-03-28 13:07:21 -06:00
accepted_encodings_bench_test.go encode: reduce allocations in AcceptedEncodings (#7847) 2026-08-01 00:23:57 +10:00
caddyfile.go encode: make zstd checksum configurable (#7586) 2026-03-28 13:07:21 -06:00
encode.go encode: Don't write an empty encoded stream for HEAD responses (#8150) 2026-10-09 18:14:56 +10:00
encode_bench_test.go encode: add standard benchmark and conformance harness (#7804) 2026-06-11 17:55:18 -06:00
encode_conformance_test.go encode: Don't write an empty encoded stream for HEAD responses (#8150) 2026-10-09 18:14:56 +10:00
encode_harness_test.go encode: add standard benchmark and conformance harness (#7804) 2026-06-11 17:55:18 -06:00
encode_test.go encode: flush headers immediately for server-sent events responses (#7905) 2026-08-01 00:27:28 +10:00
export_test.go encode: add standard benchmark and conformance harness (#7804) 2026-06-11 17:55:18 -06:00
sse_test.go feat: implement the Incremental header field (RFC 10036) (#8020) 2026-10-02 20:59:34 -04:00