From 0306d8b929b55812b4d31273c9e107c04543d39f Mon Sep 17 00:00:00 2001 From: Paolo Barbolini Date: Sat, 13 Jan 2024 10:28:01 +0100 Subject: [PATCH] Add ContentEncoding::brotli --- src/common/content_encoding.rs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/common/content_encoding.rs b/src/common/content_encoding.rs index 444eb41c..cee95fcd 100644 --- a/src/common/content_encoding.rs +++ b/src/common/content_encoding.rs @@ -22,6 +22,7 @@ use HeaderValue; /// # Example values /// /// * `gzip` +/// * `br` /// /// # Examples /// @@ -46,6 +47,12 @@ impl ContentEncoding { ContentEncoding(HeaderValue::from_static("gzip").into()) } + /// A constructor to easily create a `Content-Encoding: br` header. + #[inline] + pub fn brotli() -> ContentEncoding { + ContentEncoding(HeaderValue::from_static("br").into()) + } + /// Check if this header contains a given "coding". /// /// This can be used with these argument types: