refactor(sysopt): share macos bypass formatting

The macOS default bypass list and its three-way composition (empty ->
default, default + custom, custom only) were maintained twice: in
sysopt's format_bypass and inline in proxy_control's service_bypass.
Keep the literal once in constants and compose both paths through
format_bypass; service_bypass keeps its NUL check and UTF-8 truncation.
This commit is contained in:
Tunglies
2026-10-28 09:15:45 +08:00
parent 0474c9cd0c
commit acde039820
3 changed files with 10 additions and 13 deletions
+6
View File
@@ -14,6 +14,12 @@ pub mod network {
}
}
pub mod proxy {
/// Single source of the macOS default bypass list; both proxy backends compose from it.
pub const MACOS_DEFAULT_BYPASS: &str =
"127.0.0.1,192.168.0.0/16,10.0.0.0/8,172.16.0.0/12,localhost,*.local,*.crashlytics.com,<local>";
}
pub mod timing {
use super::Duration;