mirror of
https://github.com/rustdesk/rustdesk.git
synced 2026-03-22 20:51:17 +03:00
improve self-host server switch case https://github.com/rustdesk/rustdesk/issues/11749
This commit is contained in:
@@ -993,9 +993,19 @@ fn get_api_server_(api: String, custom: String) -> String {
|
||||
"https://admin.rustdesk.com".to_owned()
|
||||
}
|
||||
|
||||
#[inline]
|
||||
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() || url.contains("rustdesk.com") {
|
||||
if url.is_empty() || is_public(&url) {
|
||||
return "".to_owned();
|
||||
}
|
||||
format!("{}/api/audit/{}", url, typ)
|
||||
|
||||
Reference in New Issue
Block a user