fix: safe AS target detection

This commit is contained in:
Lowder
2026-03-06 00:03:47 +05:00
parent 58d9e7b68e
commit 83cf36d10a
+1 -1
View File
@@ -18,7 +18,7 @@ pub enum Target {
impl From<&str> for Target {
fn from(input: &str) -> Self {
if input.len() > 2 && input[..2].eq_ignore_ascii_case("as") {
if input.to_lowercase().starts_with("as") {
if let Ok(asn) = input[2..].parse::<u32>() {
if asn >= 1 {
return Target::Asn(asn);