diff --git a/src/common/content_encoding.rs b/src/common/content_encoding.rs index 444eb41c..a9412bda 100644 --- a/src/common/content_encoding.rs +++ b/src/common/content_encoding.rs @@ -22,6 +22,9 @@ use HeaderValue; /// # Example values /// /// * `gzip` +/// * `compress` +/// * `deflate` +/// * `br` /// /// # Examples /// @@ -46,6 +49,24 @@ impl ContentEncoding { ContentEncoding(HeaderValue::from_static("gzip").into()) } + /// A constructor to easily create a `Content-Encoding: compress` header. + #[inline] + pub fn compress() -> ContentEncoding { + ContentEncoding(HeaderValue::from_static("compress").into()) + } + + /// A constructor to easily create a `Content-Encoding: deflate` header. + #[inline] + pub fn deflate() -> ContentEncoding { + ContentEncoding(HeaderValue::from_static("deflate").into()) + } + + /// A constructor to easily create a `Content-Encoding: br` header. + #[inline] + pub fn br() -> ContentEncoding { + ContentEncoding(HeaderValue::from_static("br").into()) + } + /// Check if this header contains a given "coding". /// /// This can be used with these argument types: