From a9aa0a947448b86ae10d473dceb7e1631f0b6a31 Mon Sep 17 00:00:00 2001 From: Aaron Ang <67321817+aaron-ang@users.noreply.github.com> Date: Wed, 22 Jan 2025 03:26:37 -0800 Subject: [PATCH] feat(ext/http): Support compression on text/event-stream --- ext/http/compressible.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ext/http/compressible.rs b/ext/http/compressible.rs index 5c499f957dd2cf..293d92deb39401 100644 --- a/ext/http/compressible.rs +++ b/ext/http/compressible.rs @@ -595,6 +595,7 @@ static CONTENT_TYPES: phf::Set<&'static [u8]> = phf_set! { b"text/cmd", b"text/css", b"text/csv", + b"text/event-stream", b"text/html", b"text/javascript", b"text/jsx", @@ -651,6 +652,7 @@ mod tests { #[test] fn compressible_content_type() { assert!(is_content_compressible("application/json")); + assert!(is_content_compressible("text/event-stream")); assert!(is_content_compressible("text/plain;charset=UTF-8")); assert!(is_content_compressible("text/PlAIn; charset=utf-8")); }