1
0
mirror of https://github.com/donaldzou/WGDashboard.git synced 2024-11-22 07:10:09 +01:00

optimized pattern

This commit is contained in:
Galonza Peter 2021-10-17 20:00:12 +03:00
parent 99c42ff2c1
commit c5a7788394

View File

@ -58,8 +58,7 @@ def clean_IP_with_range(ip):
# Check IP with range (IPv4 only now)
# TODO: Add IPv6 support
def check_IP_with_range(ip):
return regex_match("((25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)(\.|\/)){4}(0|1|2|3|4|5|6|7|8|9|10|11|12|13|14|15|16|17|" +
"18|19|20|21|22|23|24|25|26|27|28|29|30|31|32)(,|$)", ip)
return regex_match("((25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)(\.|\/)){4}([0-9]{1,2})(,|$)", ip)
# Check allowed ips list
def check_Allowed_IPs(ip):