diff --git a/src/header/shared/encoding.rs b/src/header/shared/encoding.rs index b8bf32f1..32087c04 100644 --- a/src/header/shared/encoding.rs +++ b/src/header/shared/encoding.rs @@ -1,7 +1,7 @@ use std::fmt; use std::str; -pub use self::Encoding::{Chunked, Gzip, Deflate, Compress, Identity, EncodingExt}; +pub use self::Encoding::{Chunked, Brotli, Gzip, Deflate, Compress, Identity, EncodingExt}; /// A value to represent an encoding used in `Transfer-Encoding` /// or `Accept-Encoding` header. @@ -9,6 +9,8 @@ pub use self::Encoding::{Chunked, Gzip, Deflate, Compress, Identity, EncodingExt pub enum Encoding { /// The `chunked` encoding. Chunked, + /// The `br` encoding. + Brotli, /// The `gzip` encoding. Gzip, /// The `deflate` encoding. @@ -25,6 +27,7 @@ impl fmt::Display for Encoding { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { f.write_str(match *self { Chunked => "chunked", + Brotli => "br", Gzip => "gzip", Deflate => "deflate", Compress => "compress", @@ -39,6 +42,7 @@ impl str::FromStr for Encoding { fn from_str(s: &str) -> ::Result { match s { "chunked" => Ok(Chunked), + "br" => Ok(Brotli), "deflate" => Ok(Deflate), "gzip" => Ok(Gzip), "compress" => Ok(Compress),