Skip to content

Commit

Permalink
feat(headers): Implementing content-encoding header
Browse files Browse the repository at this point in the history
Closes #391
  • Loading branch information
mattnenterprise committed Mar 25, 2015
1 parent a7e2121 commit 2983e8d
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 0 deletions.
19 changes: 19 additions & 0 deletions src/header/common/content_encoding.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
use header::Encoding;

/// The `Content-Encoding` header.
///
/// This header describes the encoding of the message body. It can be
/// comma-separated, including multiple encodings.
///
/// ```notrust
/// Content-Encoding: gzip
/// ```
#[derive(Clone, PartialEq, Debug)]
pub struct ContentEncoding(pub Vec<Encoding>);

impl_list_header!(ContentEncoding,
"Content-Encoding",
Vec<Encoding>);

bench_header!(single, ContentEncoding, { vec![b"gzip".to_vec()] });
bench_header!(multiple, ContentEncoding, { vec![b"gzip, deflate".to_vec()] });
2 changes: 2 additions & 0 deletions src/header/common/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ pub use self::authorization::{Authorization, Scheme, Basic};
pub use self::cache_control::{CacheControl, CacheDirective};
pub use self::connection::{Connection, ConnectionOption};
pub use self::content_length::ContentLength;
pub use self::content_encoding::ContentEncoding;
pub use self::content_type::ContentType;
pub use self::cookie::Cookie;
pub use self::date::Date;
Expand Down Expand Up @@ -157,6 +158,7 @@ mod authorization;
mod cache_control;
mod cookie;
mod connection;
mod content_encoding;
mod content_length;
mod content_type;
mod date;
Expand Down

0 comments on commit 2983e8d

Please sign in to comment.