mirror of
https://github.com/LowderPlay/cheburcheck.git
synced 2026-09-22 22:37:59 +03:00
fix: safe AS target detection
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user