From: "Dr. Tobias Quathamer" Date: Sun, 13 Sep 2026 00:31:06 +0200 Subject: Update expected length for compression in Go 1.27. See https://go.dev/doc/go1.27#compressflatepkgcompressflate Closes: #1146201 --- compress_test.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/compress_test.go b/compress_test.go index 25fdbe9..1b533b5 100644 --- a/compress_test.go +++ b/compress_test.go @@ -136,8 +136,8 @@ func TestCompressHandlerGzip(t *testing.T) { if resp.Header.Get("Content-Type") != "text/plain; charset=utf-8" { t.Errorf("wrong content type, got %s want %s", resp.Header.Get("Content-Type"), "text/plain; charset=utf-8") } - if w.Body.Len() != 72 { - t.Errorf("wrong len, got %d want %d", w.Body.Len(), 72) + if w.Body.Len() != 68 { + t.Errorf("wrong len, got %d want %d", w.Body.Len(), 68) } if l := resp.Header.Get("Content-Length"); l != "" { t.Errorf("wrong content-length. got %q expected %q", l, "") @@ -154,8 +154,8 @@ func TestCompressHandlerDeflate(t *testing.T) { if resp.Header.Get("Content-Type") != "text/plain; charset=utf-8" { t.Fatalf("wrong content type, got %s want %s", resp.Header.Get("Content-Type"), "text/plain; charset=utf-8") } - if w.Body.Len() != 54 { - t.Fatalf("wrong len, got %d want %d", w.Body.Len(), 54) + if w.Body.Len() != 50 { + t.Fatalf("wrong len, got %d want %d", w.Body.Len(), 50) } }