fix(header): enable SetCookie.fmt_header when only 1 cookie
This commit is contained in:
@@ -90,8 +90,13 @@ impl Header for SetCookie {
|
||||
Err(::Error::Header)
|
||||
}
|
||||
}
|
||||
fn fmt_header(&self, _f: &mut fmt::Formatter) -> fmt::Result {
|
||||
panic!("SetCookie cannot be used with fmt_header, must use fmt_multi_header");
|
||||
|
||||
fn fmt_header(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||
if self.0.len() == 1 {
|
||||
write!(f, "{}", &self.0[0])
|
||||
} else {
|
||||
panic!("SetCookie with multiple cookies cannot be used with fmt_header, must use fmt_multi_header");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user