Care about error case

This commit is contained in:
Kitaiti Makoto 2021-02-04 15:31:57 +09:00
parent 191239584b
commit 348259a14b

View File

@ -153,10 +153,12 @@ where
warn!("Inbox doesn't have host: {:?}", &inbox); warn!("Inbox doesn't have host: {:?}", &inbox);
continue; continue;
}; };
headers.insert( let host_header_value = HeaderValue::from_str(&url.host_str().expect("Unreachable"));
"Host", if host_header_value.is_err() {
HeaderValue::from_str(&url.host_str().unwrap()).unwrap(), warn!("Header valid is invalid: {:?}", url.host_str());
); continue;
}
headers.insert("Host", host_header_value.unwrap());
headers.insert("Digest", request::Digest::digest(&body)); headers.insert("Digest", request::Digest::digest(&body));
rt.spawn( rt.spawn(
client client