Skip to content

Commit 00c337f

Browse files
Add ContentEncoding::brotli (#158)
1 parent e0323f5 commit 00c337f

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/common/content_encoding.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ use HeaderValue;
2222
/// # Example values
2323
///
2424
/// * `gzip`
25+
/// * `br`
2526
///
2627
/// # Examples
2728
///
@@ -46,6 +47,12 @@ impl ContentEncoding {
4647
ContentEncoding(HeaderValue::from_static("gzip").into())
4748
}
4849

50+
/// A constructor to easily create a `Content-Encoding: br` header.
51+
#[inline]
52+
pub fn brotli() -> ContentEncoding {
53+
ContentEncoding(HeaderValue::from_static("br").into())
54+
}
55+
4956
/// Check if this header contains a given "coding".
5057
///
5158
/// This can be used with these argument types:

0 commit comments

Comments
 (0)