Skip to content

Commit d00b8bb

Browse files
committed
stupid me
1 parent c735fbd commit d00b8bb

2 files changed

Lines changed: 5 additions & 7 deletions

File tree

src/common.rs

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -960,7 +960,10 @@ pub fn get_custom_rendezvous_server(custom: String) -> String {
960960

961961
#[inline]
962962
pub fn get_api_server(api: String, custom: String) -> String {
963-
let res = get_api_server_(api, custom);
963+
let mut res = get_api_server_(api, custom);
964+
if res.ends_with('/') {
965+
res.pop();
966+
}
964967
if res.starts_with("https") && res.ends_with(":21114") {
965968
return res.replace(":21114", "");
966969
}
@@ -998,11 +1001,6 @@ pub fn is_public(url: &str) -> bool {
9981001
url.contains("rustdesk.com")
9991002
}
10001003

1001-
#[inline]
1002-
pub fn is_selfhost(url: &str) -> bool {
1003-
!is_public(url)
1004-
}
1005-
10061004
pub fn get_audit_server(api: String, custom: String, typ: String) -> String {
10071005
let url = get_api_server(api, custom);
10081006
if url.is_empty() || is_public(&url) {

src/hbbs_http/sync.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ async fn start_hbbs_sync_async() {
107107
}
108108
let v = v.to_string();
109109
let mut hash = "".to_owned();
110-
if crate::is_selfhost(&url) {
110+
if crate::is_public(&url) {
111111
use sha2::{Digest, Sha256};
112112
let mut hasher = Sha256::new();
113113
hasher.update(url.as_bytes());

0 commit comments

Comments
 (0)