Skip to content

Commit

Permalink
Merge pull request #25 from CAFxX/patch-4
Browse files Browse the repository at this point in the history
use BestCompression in GzipEncoding
  • Loading branch information
vearutop authored Aug 15, 2024
2 parents 7930c34 + d400456 commit 0082811
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion server.go
Original file line number Diff line number Diff line change
Expand Up @@ -474,7 +474,10 @@ func GzipEncoding() Encoding {
},
Encoder: func(r io.Reader) ([]byte, error) {
res := bytes.NewBuffer(nil)
w := gzip.NewWriter(res)
w, err := gzip.NewWriterLevel(res, gzip.BestCompression)
if err != nil {
return nil, err
}

if _, err := io.Copy(w, r); err != nil {
return nil, err
Expand Down

0 comments on commit 0082811

Please sign in to comment.