mirror of
https://github.com/nimbold/Firelink.git
synced 2026-08-21 08:26:40 +00:00
fix: resolve P2 and P3 audit findings
This commit is contained in:
@@ -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)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user