Open rusty-snake opened 1 year ago
for line in schemeapps_conf {
let line = line.trim();
if line.is_empty() || line.starts_with('#') {
continue;
}
let (scheme, cmd) = if let Some(scheme_cmd) = line.split_once(':') {
scheme_cmd
} else {
eprintln!("ERROR: Invalid line in schemeapps.conf: {line}");
continue;
};
let mut cmd = cmd.split_whitespace()
...
}
How about using a regexp or fnmatch patterns and also explicit allow/deny:
allow http://*.example.com/* firefox %u
deny *
For more flexibility (for example, if client authentication is considered in the future), the syntax could be
allow url=https://*.example.com/* cmd='firefox %u' client='mutt'
allow url=https:* client='firefox*'
deny url=http:*
# default deny
deny
rustc
). However if everything we need is a zero/one-or-more placeholder this can be implemented easily in fireurl.