From 4b4723b958c824114437de09d86288e925781f30 Mon Sep 17 00:00:00 2001 From: Simon Marsh Date: Sat, 22 Jun 2019 22:55:01 +0100 Subject: [PATCH] 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 --- lg.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lg.py b/lg.py index 7be6010..9cbde28 100644 --- a/lg.py +++ b/lg.py @@ -79,7 +79,7 @@ def add_links(text): ret_text.append(re.sub(r'(\d+)', r'\1', line)) else: line = re.sub(r'([a-zA-Z0-9\-]*\.([a-zA-Z]{2,3}){1,2})(\s|$)', r'\1\3', line) - line = re.sub(r'AS(\d+)', r'AS\1', line) + line = re.sub(r'(?<=\[)AS(\d+)', r'AS\1', line) line = re.sub(r'(\d+\.\d+\.\d+\.\d+)', r'\1', line) if len(request.path) >= 2: hosts = "/".join(request.path.split("/")[2:])