Skip to content

Commit c3b36dd

Browse files
committed
Fixed issue #14
1 parent 2f38045 commit c3b36dd

File tree

2 files changed

+9
-5
lines changed

2 files changed

+9
-5
lines changed

Cargo.lock

+4-4
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/lib.rs

+5-1
Original file line numberDiff line numberDiff line change
@@ -710,7 +710,11 @@ impl<'x> HeaderValue<'x> {
710710
pub fn get_content_type(&self) -> &ContentType<'x> {
711711
match *self {
712712
HeaderValue::ContentType(ref ct) => ct,
713-
_ => panic!("HeaderValue::get_content_type called on non-ContentType value"),
713+
HeaderValue::Collection(ref c) => c.last().unwrap().get_content_type(),
714+
_ => panic!(
715+
"HeaderValue::get_content_type called on non-ContentType: {:?}",
716+
self
717+
),
714718
}
715719
}
716720

0 commit comments

Comments
 (0)