fix: resolve P2 and P3 audit findings

This commit is contained in:
NimBold
2026-06-15 14:18:16 +03:30
parent 285ec0a81d
commit 789a8161b2
6 changed files with 157 additions and 28 deletions
+2 -3
View File
@@ -8,9 +8,8 @@ pub async fn get_system_proxy() -> Result<Option<String>, String> {
match sysproxy::Sysproxy::get_system_proxy() {
Ok(proxy) => {
if proxy.enable {
// Determine protocol, usually sysproxy returns the host and port
// We'll default to http:// unless the user has configured something specific
Ok(Some(format!("http://{}:{}", proxy.host, proxy.port)))
let protocol = if proxy.host.contains("://") { "" } else { "http://" };
Ok(Some(format!("{}{}:{}", protocol, proxy.host, proxy.port)))
} else {
Ok(None)
}