Handle non-utf8 status and headers
Non-utf8 headers are ignored and reading the value for them will yield `None`.
This commit is contained in:
@@ -386,7 +386,9 @@ fn send_prelude(unit: &Unit, stream: &mut Stream, redir: bool) -> io::Result<()>
|
||||
// other headers
|
||||
for header in &unit.headers {
|
||||
if !redir || !header.is_name("Authorization") {
|
||||
write!(prelude, "{}: {}\r\n", header.name(), header.value())?;
|
||||
if let Some(v) = header.value() {
|
||||
write!(prelude, "{}: {}\r\n", header.name(), v)?;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user