summaryrefslogtreecommitdiff
path: root/ext/http/lib.rs
diff options
context:
space:
mode:
authorMatt Mastracci <matthew@mastracci.com>2023-08-04 12:39:39 -0600
committerGitHub <noreply@github.com>2023-08-04 12:39:39 -0600
commit8ae706293149fb6e3d40af3ac80a8661fa379111 (patch)
tree29ee1b801e9d0341f7ce1354c35d35e64b930381 /ext/http/lib.rs
parent72d9f0609094adee954b271db12ca4c834f6b860 (diff)
fix(ext/http): serveHttp brotli compression level should be fastest (#20058)
Use brotli's fastest mode rather than default mode
Diffstat (limited to 'ext/http/lib.rs')
-rw-r--r--ext/http/lib.rs4
1 files changed, 3 insertions, 1 deletions
diff --git a/ext/http/lib.rs b/ext/http/lib.rs
index 21c051cae..8060b5a1e 100644
--- a/ext/http/lib.rs
+++ b/ext/http/lib.rs
@@ -743,7 +743,9 @@ fn http_response(
let (reader, _) = tokio::io::split(a);
let (_, writer) = tokio::io::split(b);
let writer: Pin<Box<dyn tokio::io::AsyncWrite>> = match encoding {
- Encoding::Brotli => Box::pin(BrotliEncoder::new(writer)),
+ Encoding::Brotli => {
+ Box::pin(BrotliEncoder::with_quality(writer, Level::Fastest))
+ }
Encoding::Gzip => Box::pin(GzipEncoder::with_quality(
writer,
Level::Precise(GZIP_DEFAULT_COMPRESSION_LEVEL.into()),