Prevent 4-byte AS capability from being treated like it is ASN

Sileht pull request #50
https://github.com/sileht/bird-lg/pull/50/files
This commit is contained in:
Simon Marsh 2019-06-22 22:55:01 +01:00
parent 08c1d47e64
commit 4b4723b958
Signed by: burble
GPG Key ID: 7B9FE8780CFB6593

2
lg.py
View File

@ -79,7 +79,7 @@ def add_links(text):
ret_text.append(re.sub(r'(\d+)', r'<a href="/whois?q=\1" class="whois">\1</a>', line))
else:
line = re.sub(r'([a-zA-Z0-9\-]*\.([a-zA-Z]{2,3}){1,2})(\s|$)', r'<a href="/whois?q=\1" class="whois">\1</a>\3', line)
line = re.sub(r'AS(\d+)', r'<a href="/whois?q=\1" class="whois">AS\1</a>', line)
line = re.sub(r'(?<=\[)AS(\d+)', r'<a href="/whois?q=\1" class="whois">AS\1</a>', line)
line = re.sub(r'(\d+\.\d+\.\d+\.\d+)', r'<a href="/whois?q=\1" class="whois">\1</a>', line)
if len(request.path) >= 2:
hosts = "/".join(request.path.split("/")[2:])