Describe the bug
The regular expression used to extract the AS or IXP number from strings will accept an arbitrary prefix as long as the string ends with a number. This can lead to confusion, especially if an IXP link is mistyped.
The result is actually for AS208, instead of IXP208 (DE-CIX) since the P is missing from the URL. This is not directly obvious, especially sind the string IX208 is automatically inserted into the heading.
Expected behavior
At least, the arbitrary string should not be displayed in the header, but corrected to ASXXX instead. However, the best solution would probably be to only accept ^AS[0-9]+$ and ^IXP[0-9]+$ strings and show an error / redirect to 404 otherwise.
Screenshots
Report for IX208, which is actually AS208
Additional context
The problematic function is ihr_AsOrIxpToNumber in IhrApi.js
Thanks, that's fixed now (2166539f020d2f4f8ea73b081ab342b103d0b1e0) but eventually we'd need a proper page for IXPs. The current has meaningless things for IXPs (ROV, AS hegemony)
Describe the bug The regular expression used to extract the AS or IXP number from strings will accept an arbitrary prefix as long as the string ends with a number. This can lead to confusion, especially if an IXP link is mistyped.
To Reproduce
P
is missing from the URL. This is not directly obvious, especially sind the stringIX208
is automatically inserted into the heading.Expected behavior At least, the arbitrary string should not be displayed in the header, but corrected to
ASXXX
instead. However, the best solution would probably be to only accept^AS[0-9]+$
and^IXP[0-9]+$
strings and show an error / redirect to 404 otherwise.Screenshots Report for![image](https://user-images.githubusercontent.com/49444122/175210139-f2eb3016-2a4c-4547-ac27-bff682c94596.png)
IX208
, which is actuallyAS208
Additional context The problematic function is
ihr_AsOrIxpToNumber
in IhrApi.js