fix: resolve double ASN display in ASPA provider badges

This commit is contained in:
Rene Fichtmueller 2026-03-26 11:20:02 +13:00
parent cdf21b9e8e
commit 405bfd01c7
2 changed files with 3 additions and 2 deletions

View File

@ -433,7 +433,8 @@ function renderAspa(d) {
h += '<div style="font-size:.8rem;font-weight:600;color:var(--orange);margin:.75rem 0 .4rem">Detected Upstream Providers</div>';
h += '<div style="display:flex;flex-wrap:wrap;gap:.3rem;margin-bottom:1rem">';
d.detected_providers.forEach(function(p) {
h += '<span class="badge badge-orange">' + asnLink(p.asn) + ' ' + escHtml(p.name) + '</span>';
var nameStr = (p.name && p.name !== 'AS' + p.asn) ? ' ' + escHtml(p.name) : '';
h += '<span class="badge badge-orange">' + asnLink(p.asn) + nameStr + '</span>';
});
h += '</div>';
}

View File

@ -182,7 +182,7 @@ const server = http.createServer(async (req, res) => {
const detectedProviders = [...upstreamSet].map((asn) => {
const nb = leftNeighbours.find((n) => n.asn === asn);
return { asn, name: nb ? nb.as_name || "AS" + asn : "AS" + asn };
return { asn, name: nb && nb.as_name ? nb.as_name : "" };
});
// Check RIPE DB for ASPA references