From 2298faa4c2bbadfdd076e3a0d1c5582acdc05337 Mon Sep 17 00:00:00 2001 From: Paolo Barbolini Date: Sat, 8 Jun 2024 14:27:03 +0200 Subject: [PATCH] Add `ContentEncoding::zstd` --- 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 3421ac5c..c218ea96 100644 --- a/src/common/content_encoding.rs +++ b/src/common/content_encoding.rs @@ -24,6 +24,7 @@ use crate::util::FlatCsv; /// /// * `gzip` /// * `br` +/// * `zstd` /// /// # Examples /// @@ -53,6 +54,12 @@ impl ContentEncoding { ContentEncoding(HeaderValue::from_static("br").into()) } + /// A constructor to easily create a `Content-Encoding: zstd` header. + #[inline] + pub fn zstd() -> ContentEncoding { + ContentEncoding(HeaderValue::from_static("zstd").into()) + } + /// Check if this header contains a given "coding". /// /// This can be used with these argument types: