Skip to content

Commit

Permalink
fix(ark-cli): only list valid links
Browse files Browse the repository at this point in the history
Signed-off-by: Tarek <[email protected]>
  • Loading branch information
tareknaser committed Jun 15, 2024
1 parent 88e3bfc commit 2ec4eeb
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion ark-cli/src/commands/list.rs
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,17 @@ impl List {
Ok(mut file) => {
let mut contents = String::new();
match file.read_to_string(&mut contents) {
Ok(_) => (None, None, Some(contents)),
Ok(_) => {
// Check if the content of the file is a valid url
let url = contents.trim();
let url = url::Url::parse(url);
match url {
Ok(url) => {
(None, None, Some(url.to_string()))
}
Err(_) => return None,
}
}
Err(_) => return None,
}
}
Expand Down

0 comments on commit 2ec4eeb

Please sign in to comment.