Skip to content

Commit

Permalink
Merge pull request #35 from futurist/master
Browse files Browse the repository at this point in the history
fix: unwrap panic with more info
  • Loading branch information
hatoo authored Jul 8, 2024
2 parents 70d49aa + d275641 commit 8c64854
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -260,11 +260,11 @@ impl<C: Borrow<rcgen::CertifiedKey> + Send + Sync + 'static> MitmProxy<C> {
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
};

Expand Down Expand Up @@ -342,7 +342,7 @@ impl<C: Borrow<rcgen::CertifiedKey> + Send + Sync + 'static> MitmProxy<C> {
))
} 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 {
Expand Down

0 comments on commit 8c64854

Please sign in to comment.