mirror of
https://github.com/rustdesk/rustdesk.git
synced 2026-04-21 03:03:20 +03:00
stupid me
This commit is contained in:
@@ -960,7 +960,10 @@ pub fn get_custom_rendezvous_server(custom: String) -> String {
|
|||||||
|
|
||||||
#[inline]
|
#[inline]
|
||||||
pub fn get_api_server(api: String, custom: String) -> String {
|
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") {
|
if res.starts_with("https") && res.ends_with(":21114") {
|
||||||
return res.replace(":21114", "");
|
return res.replace(":21114", "");
|
||||||
}
|
}
|
||||||
@@ -998,11 +1001,6 @@ pub fn is_public(url: &str) -> bool {
|
|||||||
url.contains("rustdesk.com")
|
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 {
|
pub fn get_audit_server(api: String, custom: String, typ: String) -> String {
|
||||||
let url = get_api_server(api, custom);
|
let url = get_api_server(api, custom);
|
||||||
if url.is_empty() || is_public(&url) {
|
if url.is_empty() || is_public(&url) {
|
||||||
|
|||||||
@@ -107,7 +107,7 @@ async fn start_hbbs_sync_async() {
|
|||||||
}
|
}
|
||||||
let v = v.to_string();
|
let v = v.to_string();
|
||||||
let mut hash = "".to_owned();
|
let mut hash = "".to_owned();
|
||||||
if crate::is_selfhost(&url) {
|
if crate::is_public(&url) {
|
||||||
use sha2::{Digest, Sha256};
|
use sha2::{Digest, Sha256};
|
||||||
let mut hasher = Sha256::new();
|
let mut hasher = Sha256::new();
|
||||||
hasher.update(url.as_bytes());
|
hasher.update(url.as_bytes());
|
||||||
|
|||||||
Reference in New Issue
Block a user