diff --git a/src/lib.rs b/src/lib.rs index 2db9b46..df8b57c 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -260,11 +260,11 @@ impl + Send + Sync + 'static> MitmProxy { if uri.authority() == Some(&connect_authority) { send_request_connect.send_request(req).await } else { - let mut sender = proxy.connect(req.uri()).await.unwrap(); + let mut sender = proxy.connect(req.uri()).await.expect(&format!("connect uri: {}", req.uri())); sender.send_request(req).await } } else { - let mut sender = proxy.connect(req.uri()).await.unwrap(); + let mut sender = proxy.connect(req.uri()).await.expect(&format!("connect uri: {}", req.uri())); sender.send_request(req).await }; @@ -342,7 +342,7 @@ impl + Send + Sync + 'static> MitmProxy { )) } else { let uri = req.uri().clone(); - let mut sender = proxy.connect(req.uri()).await.unwrap(); + let mut sender = proxy.connect(req.uri()).await.expect(&format!("connect uri: {}", req.uri())); let (req, req_parts) = dup_request(req); let (status, res, res_upgrade) = match sender.send_request(req).await {