diff --git a/main.py b/main.py index 41141d8..b26d01f 100644 --- a/main.py +++ b/main.py @@ -12,6 +12,7 @@ def get_asn_from_as(asn): # Remove the "AS" from the beginning of the ASN if asn.startswith("AS") or asn.startswith("as"): asn = asn[2:] + asn = int(asn) return asn def get_more_specifics(data): """ @@ -90,11 +91,10 @@ def is_valid_prefix(prefix): return False def is_valid_asn(asn): - # Check if the ASN is a string starting with "AS", followed by numbers - if re.match(r'^[Aa][Ss]\d+$', asn): + # Check if the ASN is a string starting with "AS", followed by numbers or just a number + if type(asn) is int: return True - # Check if the ASN is just numbers - elif asn.isdigit(): + if re.match(r'^[Aa][Ss]\d+$', asn): return True else: return False diff --git a/templates/index.html b/templates/index.html index 1f7647e..c5a8894 100644 --- a/templates/index.html +++ b/templates/index.html @@ -43,7 +43,7 @@

This app queries the stat.ripe.net to determine if a RPKI-ROA created with the following information
would likely agree (i.e., not evaluate as invalid) for routes currently seen in the Internet

-
> +