stupid me

This commit is contained in:
rustdesk
2025-05-13 22:40:49 +08:00
parent c735fbd54c
commit d00b8bb580
2 changed files with 5 additions and 7 deletions

View File

@@ -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) {

View File

@@ -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());