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() .send()
.await; .await;
let session_id = match response { let session_id = match response {
Ok(ref resp) => resp.headers() Ok(ref resp) =>
.get("x-transmission-session-id") match resp.headers().get("x-transmission-session-id") {
.expect("Unable to get session id") Some(res) => res.to_str().expect("header value should be a string"),
.to_str() _ => ""
.unwrap(), }
_ => "" _ => ""
}.to_owned(); }.to_owned();
info!("Received session id: {}", session_id); info!("Received session id: {}", session_id);