expected header not to be present

This commit is contained in:
red 2020-11-01 14:06:22 +01:00
parent 8d98d1f4bc
commit 989f1cf8d0

View File

@ -64,11 +64,11 @@ impl TransClient {
.send()
.await;
let session_id = match response {
Ok(ref resp) => resp.headers()
.get("x-transmission-session-id")
.expect("Unable to get session id")
.to_str()
.unwrap(),
Ok(ref resp) =>
match resp.headers().get("x-transmission-session-id") {
Some(res) => res.to_str().expect("header value should be a string"),
_ => ""
}
_ => ""
}.to_owned();
info!("Received session id: {}", session_id);