Skip to content

Commit 8c9e99e

Browse files
committed
feat: zstd content-coding support
1 parent 564879f commit 8c9e99e

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/common/content_coding.rs

+3
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,7 @@ define_content_coding! {
108108
DEFLATE; "deflate",
109109
GZIP; "gzip",
110110
IDENTITY; "identity",
111+
ZSTD; "zstd",
111112
}
112113

113114
#[cfg(test)]
@@ -128,6 +129,7 @@ mod tests {
128129
fn from_str() {
129130
assert_eq!(ContentCoding::from_str("br"), ContentCoding::BROTLI);
130131
assert_eq!(ContentCoding::from_str("GZIP"), ContentCoding::GZIP);
132+
assert_eq!(ContentCoding::from_str("zstd"), ContentCoding::ZSTD);
131133
assert_eq!(
132134
ContentCoding::from_str("blah blah"),
133135
ContentCoding::IDENTITY
@@ -137,6 +139,7 @@ mod tests {
137139
#[test]
138140
fn try_from_str() {
139141
assert_eq!(ContentCoding::try_from_str("br"), Ok(ContentCoding::BROTLI));
142+
assert_eq!(ContentCoding::try_from_str("zstd"), Ok(ContentCoding::ZSTD));
140143
assert_eq!(ContentCoding::try_from_str("blah blah"), Err(()));
141144
}
142145
}

0 commit comments

Comments
 (0)