diff --git a/zstd.go b/zstd.go index a54d2569b4..15ab2463d0 100644 --- a/zstd.go +++ b/zstd.go @@ -8,6 +8,7 @@ import ( "github.com/klauspost/compress/zstd" "github.com/valyala/bytebufferpool" + "github.com/valyala/fasthttp/stackless" ) @@ -149,7 +150,7 @@ func nonblockingWriteZstd(ctxv any) { // AppendZstdBytes appends zstd src to dst and returns the resulting dst. func AppendZstdBytes(dst, src []byte) []byte { - return AppendZstdBytesLevel(dst, src, CompressBrotliDefaultCompression) + return AppendZstdBytesLevel(dst, src, CompressZstdDefault) } // WriteUnzstd writes unzstd p to w and returns the number of uncompressed diff --git a/zstd_test.go b/zstd_test.go index dc0c45f339..620ef7d708 100644 --- a/zstd_test.go +++ b/zstd_test.go @@ -38,7 +38,7 @@ func testZstdBytesSingleCase(s string) error { if !bytes.Equal(ZstdpedS[:len(prefix)], prefix) { return fmt.Errorf("unexpected prefix when compressing %q: %q. Expecting %q", s, ZstdpedS[:len(prefix)], prefix) } - + unZstdedS, err := AppendUnzstdBytes(prefix, ZstdpedS[len(prefix):]) if err != nil { return fmt.Errorf("unexpected error when uncompressing %q: %w", s, err)