diff options
| author | Aaron O'Mullan <aaron.omullan@gmail.com> | 2022-04-24 16:45:56 -0300 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-04-24 21:45:56 +0200 |
| commit | e2fba7b967cba1e690ad24e12f9db1d329a0c938 (patch) | |
| tree | 03c95d25b686924d7aab3bb2b6e2eb7ccc1cc62d /ext/http/lib.rs | |
| parent | 8107a79b391d94db7fbf44e2529c650fe3adaf27 (diff) | |
perf(ext/http): faster is_content_compressible (#14383)
Cleanup + benches
Diffstat (limited to 'ext/http/lib.rs')
| -rw-r--r-- | ext/http/lib.rs | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/ext/http/lib.rs b/ext/http/lib.rs index 4911c543b..1888409ba 100644 --- a/ext/http/lib.rs +++ b/ext/http/lib.rs @@ -65,7 +65,7 @@ use tokio::io::AsyncWriteExt; use tokio::task::spawn_local; use tokio_util::io::ReaderStream; -mod compressible; +pub mod compressible; pub fn init() -> Extension { Extension::builder() @@ -542,8 +542,9 @@ async fn op_http_write_headers( } if headers_allow_compression { - body_compressible = - compressible::is_content_compressible(content_type_header); + body_compressible = content_type_header + .map(compressible::is_content_compressible) + .unwrap_or_default(); } let body: Response<Body>; |
