fix: allow additional URL schemes in parse_command function (#125)

* fix: allow additional URL schemes in parse_command function

* fix: enhance URL validation in parse_command function to support lowercase schemes
This commit is contained in:
Zhiwei Li
2026-01-18 10:36:38 -06:00
committed by GitHub
parent d02ef66c89
commit 59baf97e51
+6 -1
View File
@@ -75,7 +75,12 @@ pub fn parse_command(args: &[String], flags: &Flags) -> Result<Value, ParseError
context: cmd.to_string(),
usage: "open <url>",
})?;
let url = if url.starts_with("http") {
let url_lower = url.to_lowercase();
let url = if url_lower.starts_with("http://")
|| url_lower.starts_with("https://")
|| url_lower.starts_with("about:")
|| url_lower.starts_with("data:")
|| url_lower.starts_with("file:") {
url.to_string()
} else {
format!("https://{}", url)