Skip to content

Commit

Permalink
Refactor scheme_host_port function to simplify HTTP/2 handling
Browse files Browse the repository at this point in the history
  • Loading branch information
arloor committed Sep 17, 2024
1 parent 33b15c2 commit bc9917c
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions rust_http_proxy/src/proxy.rs
Original file line number Diff line number Diff line change
Expand Up @@ -428,7 +428,7 @@ fn scheme_host_port(req: &Request<Incoming>, server_over_tls: bool) -> (String,
true => "https",
false => "http",
});
let result = if req.version() == Version::HTTP_2 {
if req.version() == Version::HTTP_2 {
//H2,信息全在uri中
(
scheme.to_owned(),
Expand Down Expand Up @@ -460,8 +460,7 @@ fn scheme_host_port(req: &Request<Incoming>, server_over_tls: bool) -> (String,
_ => 443,
});
(scheme.to_owned(), host, port)
};
result
}
}

fn handle_redirect(
Expand Down

0 comments on commit bc9917c

Please sign in to comment.