* 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
(cherry picked from commit
|
||
|---|---|---|
| .. | ||
| brotli | ||
| gzip | ||
| testdata | ||
| zstd | ||
| accepted_encodings_bench_test.go | ||
| caddyfile.go | ||
| encode.go | ||
| encode_bench_test.go | ||
| encode_conformance_test.go | ||
| encode_harness_test.go | ||
| encode_test.go | ||
| export_test.go | ||
| sse_test.go | ||