From fd669fe772eb3cf3e72d619626e4a9434e9c01ea Mon Sep 17 00:00:00 2001 From: Andrew DalPino Date: Tue, 24 Aug 2021 22:00:57 -0500 Subject: [PATCH] Change default compression level --- README.md | 2 +- src/HTTP/Middleware/CompressRequestBody.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index fec905c..bb6e39e 100644 --- a/README.md +++ b/README.md @@ -151,7 +151,7 @@ Apply the Gzip compression algorithm to the request body. #### Parameters | # | Param | Default | Type | Description | |---|---|---|---|---| -| 1 | level | 1 | int | The compression level between 0 and 9 with 0 meaning no compression. | +| 1 | level | 5 | int | The compression level between 0 and 9 with 0 meaning no compression. | | 2 | threshold | 65535 | int | The minimum size of the request body in bytes in order to be compressed. | **Example** diff --git a/src/HTTP/Middleware/CompressRequestBody.php b/src/HTTP/Middleware/CompressRequestBody.php index f4a7a79..2a21fb8 100644 --- a/src/HTTP/Middleware/CompressRequestBody.php +++ b/src/HTTP/Middleware/CompressRequestBody.php @@ -44,7 +44,7 @@ class CompressRequestBody implements Middleware * @param int $threshold * @throws \Rubix\Client\Exceptions\InvalidArgumentException */ - public function __construct(int $level = 1, int $threshold = self::MAX_MTU) + public function __construct(int $level = 5, int $threshold = self::MAX_MTU) { if ($level < 0 or $level > 9) { throw new InvalidArgumentException('Level must be'