diff --git a/src/common.rs b/src/common.rs index 9f627f39a..f6c9ce0df 100644 --- a/src/common.rs +++ b/src/common.rs @@ -960,7 +960,10 @@ pub fn get_custom_rendezvous_server(custom: String) -> String { #[inline] pub fn get_api_server(api: String, custom: String) -> String { - let res = get_api_server_(api, custom); + let mut res = get_api_server_(api, custom); + if res.ends_with('/') { + res.pop(); + } if res.starts_with("https") && res.ends_with(":21114") { return res.replace(":21114", ""); } @@ -998,11 +1001,6 @@ pub fn is_public(url: &str) -> bool { url.contains("rustdesk.com") } -#[inline] -pub fn is_selfhost(url: &str) -> bool { - !is_public(url) -} - pub fn get_audit_server(api: String, custom: String, typ: String) -> String { let url = get_api_server(api, custom); if url.is_empty() || is_public(&url) { diff --git a/src/hbbs_http/sync.rs b/src/hbbs_http/sync.rs index abf62f393..c579cf042 100644 --- a/src/hbbs_http/sync.rs +++ b/src/hbbs_http/sync.rs @@ -107,7 +107,7 @@ async fn start_hbbs_sync_async() { } let v = v.to_string(); let mut hash = "".to_owned(); - if crate::is_selfhost(&url) { + if crate::is_public(&url) { use sha2::{Digest, Sha256}; let mut hasher = Sha256::new(); hasher.update(url.as_bytes());