Skip to content

v1.24.1 — Go 1.24.13 + utls v1.8.2 (Content-Length fix)

Choose a tag to compare

@dteh dteh released this 23 May 16:10
· 7 commits to master since this release

Upstream Go: go1.24.13
utls: v1.8.2
go.mod directive: go 1.24.0
Supported Go versions: 1.24.0 – 1.24.13

Bug fix release

Fixes a regression where dhttp stripped Content-Length and Content-Encoding from every response (not just compressed ones). After this fix:

  • res.ContentLength is set correctly for plain responses
  • res.Header.Get("Content-Length") returns the value the server sent
  • Streaming and length-aware consumers (e.g. file servers, range requests) work as expected

Affected both HTTP/1.1 and HTTP/2 paths. Root cause: dhttp's multi-codec auto-decompression extended the gzip-only path but dropped the Content-Encoding == "gzip" guard that vanilla net/http uses before stripping. The fix restores the guard, gated on Content-Encoding matching one of the supported codecs (gzip, br, deflate, zstd).

Recommended upgrade

Anyone on v1.24.0 should upgrade immediately:

go get github.com/dteh/dhttp@v1.24.1

Changes since v1.24.0

  • Fix Content-Length stripped on every non-compressed response (transport.go + h2_bundle.go)

Tests recovered as canaries: TestEarlyHintsRequest, TestFileServerMethods, TestTrailersServerToClient, ExampleDumpResponse.