1
0
Fork 0
mirror of https://github.com/sileht/bird-lg.git synced 2024-11-21 14:34:43 +01:00

Merge pull request #50 from tamihiro/new-pr-batch-2

Prevent 4-byte AS capability from being treated like it is ASN
This commit is contained in:
zorun 2019-08-28 10:53:42 +02:00 committed by GitHub
commit 0e9dcd7946
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

2
lg.py
View file

@ -76,7 +76,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:])