aboutsummaryrefslogtreecommitdiff
path: root/src/https.rs
diff options
context:
space:
mode:
authorAlex Auvolat <alex@adnab.me>2022-12-06 14:24:00 +0100
committerAlex Auvolat <alex@adnab.me>2022-12-06 14:24:00 +0100
commit9bd922adf931e1ba2cf2ec55995c06420fe8c46c (patch)
treef2cbd3cd2cbbe61376d826cf85fa76923fea0a1e /src/https.rs
parent8d1162f20694d5d8551879e7ba9b34c817f0caed (diff)
downloadtricot-9bd922adf931e1ba2cf2ec55995c06420fe8c46c.tar.gz
tricot-9bd922adf931e1ba2cf2ec55995c06420fe8c46c.zip
Cargo clippydocker-44
Diffstat (limited to 'src/https.rs')
-rw-r--r--src/https.rs8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/https.rs b/src/https.rs
index ce9c61f..6e83c9e 100644
--- a/src/https.rs
+++ b/src/https.rs
@@ -213,7 +213,7 @@ async fn select_target_and_proxy(
let host = if let Some(auth) = req.uri().authority() {
auth.as_str()
} else {
- match req.headers().get("host").map(|x| x.to_str().ok()).flatten() {
+ match req.headers().get("host").and_then(|x| x.to_str().ok()) {
Some(host) => host,
None => {
return Response::builder()
@@ -268,7 +268,7 @@ async fn select_target_and_proxy(
debug!("{}{} -> {}", host, path, proxy_to);
trace!("Request: {:?}", req);
- let response = match do_proxy(&https_config, remote_addr, req, proxy_to).await {
+ let response = match do_proxy(https_config, remote_addr, req, proxy_to).await {
Ok(resp) => resp,
Err(e) => Response::builder()
.status(StatusCode::BAD_GATEWAY)
@@ -279,7 +279,7 @@ async fn select_target_and_proxy(
proxy_to.calls_in_progress.fetch_sub(1, Ordering::SeqCst);
metrics
.request_proxy_duration
- .record(received_time.elapsed().as_secs_f64(), &tags);
+ .record(received_time.elapsed().as_secs_f64(), tags);
trace!("Final response: {:?}", response);
info!("{} {} {}", method, response.status().as_u16(), uri);
@@ -323,7 +323,7 @@ async fn do_proxy(
}
if https_config.enable_compression {
- response = try_compress(response, method, accept_encoding, &https_config).await?
+ response = try_compress(response, method, accept_encoding, https_config).await?
};
Ok(response)