Redirect /32 (IPv4) and /128 (IPv6) networks to individual IP address page

parent f7592c75
......@@ -22,6 +22,10 @@ router.get("/:zero/:one([0-9][0-9]?[0-9]?)", (req: Request, res: Response, next:
next();
} else if(isIp.v6(ip) && addressLength > 128) {
next();
} else if(isIp.v4(ip) && addressLength === 32) {
res.redirect(301, `/ip/${ip}`);
} else if(isIp.v6(ip) && addressLength === 128) {
res.redirect(301, `/ip/${ip}`);
} else {
const cidrNotation = `${ip}/${addressLength}`;
const ipVersion = isIp.version(ip);
......
......@@ -30,7 +30,7 @@
{% endif %}
{% if announcements %}
{% if announcements|length > 0 %}
<h2>BGP announcements</h2>
<table class="table w-auto">
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment