Files
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
..