diff --git a/app/router.go b/app/router.go index 754b025c7b..0bfbbd4d5b 100644 --- a/app/router.go +++ b/app/router.go @@ -150,7 +150,7 @@ func RegisterReportPostHandler(a Adder, router *mux.Router) { // a.Add(..., buf) assumes buf is gzip'd msgpack if !isMsgpack { buf = bytes.Buffer{} - rpt.WriteBinary(&buf, gzip.BestCompression) + rpt.WriteBinary(&buf, gzip.DefaultCompression) } if err := a.Add(ctx, rpt, buf.Bytes()); err != nil { diff --git a/probe/appclient/report_publisher.go b/probe/appclient/report_publisher.go index 8d426d8532..64777e251b 100644 --- a/probe/appclient/report_publisher.go +++ b/probe/appclient/report_publisher.go @@ -29,6 +29,6 @@ func (p *ReportPublisher) Publish(r report.Report) error { }) } buf := &bytes.Buffer{} - r.WriteBinary(buf, gzip.BestCompression) + r.WriteBinary(buf, gzip.DefaultCompression) return p.publisher.Publish(buf) } diff --git a/report/marshal_test.go b/report/marshal_test.go index 3a4c9b76d2..19af7b7fed 100644 --- a/report/marshal_test.go +++ b/report/marshal_test.go @@ -12,7 +12,7 @@ import ( func TestRoundtrip(t *testing.T) { var buf bytes.Buffer r1 := report.MakeReport() - r1.WriteBinary(&buf, gzip.BestCompression) + r1.WriteBinary(&buf, gzip.DefaultCompression) bytes := append([]byte{}, buf.Bytes()...) // copy the contents for later r2, err := report.MakeFromBinary(&buf) if err != nil { @@ -49,7 +49,7 @@ func TestMoreCompressionMeansSmaller(t *testing.T) { // Make sure that 0 level compression actually does compress less. var buf1, buf2 bytes.Buffer r := report.MakeReport() - r.WriteBinary(&buf1, gzip.BestCompression) + r.WriteBinary(&buf1, gzip.DefaultCompression) r.WriteBinary(&buf2, 0) if buf1.Len() >= buf2.Len() { t.Errorf("Compression doesn't change size: %v >= %v", buf1.Len(), buf2.Len())