mirror of
https://github.com/clash-verge-rev/clash-verge-rev
synced 2025-05-06 07:13:44 +08:00
fix: use default bypass when empty
This commit is contained in:
parent
9150c9c40e
commit
9aeba20086
@ -63,7 +63,16 @@ impl Sysopt {
|
|||||||
enable,
|
enable,
|
||||||
host: String::from("127.0.0.1"),
|
host: String::from("127.0.0.1"),
|
||||||
port,
|
port,
|
||||||
bypass: bypass.unwrap_or(DEFAULT_BYPASS.into()),
|
bypass: match bypass {
|
||||||
|
Some(bypass) => {
|
||||||
|
if bypass.is_empty() {
|
||||||
|
DEFAULT_BYPASS.into()
|
||||||
|
} else {
|
||||||
|
bypass
|
||||||
|
}
|
||||||
|
}
|
||||||
|
None => DEFAULT_BYPASS.into(),
|
||||||
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
if enable {
|
if enable {
|
||||||
@ -101,7 +110,16 @@ impl Sysopt {
|
|||||||
let mut sysproxy = cur_sysproxy.take().unwrap();
|
let mut sysproxy = cur_sysproxy.take().unwrap();
|
||||||
|
|
||||||
sysproxy.enable = enable;
|
sysproxy.enable = enable;
|
||||||
sysproxy.bypass = bypass.unwrap_or(DEFAULT_BYPASS.into());
|
sysproxy.bypass = match bypass {
|
||||||
|
Some(bypass) => {
|
||||||
|
if bypass.is_empty() {
|
||||||
|
DEFAULT_BYPASS.into()
|
||||||
|
} else {
|
||||||
|
bypass
|
||||||
|
}
|
||||||
|
}
|
||||||
|
None => DEFAULT_BYPASS.into(),
|
||||||
|
};
|
||||||
|
|
||||||
let port = Config::verge()
|
let port = Config::verge()
|
||||||
.latest()
|
.latest()
|
||||||
@ -281,7 +299,16 @@ impl Sysopt {
|
|||||||
enable: true,
|
enable: true,
|
||||||
host: "127.0.0.1".into(),
|
host: "127.0.0.1".into(),
|
||||||
port,
|
port,
|
||||||
bypass: bypass.unwrap_or(DEFAULT_BYPASS.into()),
|
bypass: match bypass {
|
||||||
|
Some(bypass) => {
|
||||||
|
if bypass.is_empty() {
|
||||||
|
DEFAULT_BYPASS.into()
|
||||||
|
} else {
|
||||||
|
bypass
|
||||||
|
}
|
||||||
|
}
|
||||||
|
None => DEFAULT_BYPASS.into(),
|
||||||
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
log_err!(sysproxy.set_system_proxy());
|
log_err!(sysproxy.set_system_proxy());
|
||||||
|
Loading…
x
Reference in New Issue
Block a user