From 20ac39067d5894c90a20ae1d3dfb153146751fd7 Mon Sep 17 00:00:00 2001 From: Taqman-probe Date: Wed, 27 May 2026 16:44:17 +0900 Subject: [PATCH] Skip TLS detection when healthcheck: false --- src/utils/healthcheck.rs | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/src/utils/healthcheck.rs b/src/utils/healthcheck.rs index b4d9a01..427477f 100644 --- a/src/utils/healthcheck.rs +++ b/src/utils/healthcheck.rs @@ -53,15 +53,14 @@ async fn build_upstreams(fullist: &UpstreamsDashMap, method: &str, client: &Clie let mut innervec = Vec::new(); for upstream in path_entry.value().0.iter() { - let tls = detect_tls(upstream.address.as_ref(), &upstream.port, client).await; - let is_h2 = matches!(tls.1, Some(Version::HTTP_2)); - - let link = if tls.0 { - format!("https://{}:{}{}", upstream.address, upstream.port, path) + let tls = if upstream.healthcheck.unwrap_or(true) { + detect_tls(upstream.address.as_ref(), &upstream.port, client).await } else { - format!("http://{}:{}{}", upstream.address, upstream.port, path) + (false, None) }; + let is_h2 = matches!(tls.1, Some(Version::HTTP_2)); + let mut scheme = InnerMap { address: upstream.address.clone(), port: upstream.port, @@ -76,6 +75,12 @@ async fn build_upstreams(fullist: &UpstreamsDashMap, method: &str, client: &Clie }; if scheme.healthcheck.unwrap_or(true) { + let link = if tls.0 { + format!("https://{}:{}{}", upstream.address, upstream.port, path) + } else { + format!("http://{}:{}{}", upstream.address, upstream.port, path) + }; + let resp = http_request(&link, method, "", client).await; if resp.0 { if resp.1 {