Commit e01e8ba9 authored by Karsten Loesing's avatar Karsten Loesing
Browse files

Accept empty AS names.

Partially takes back b45c630b.
parent 2e278f68
......@@ -250,11 +250,6 @@ public class LookupService {
}
String asNumber = "AS" + String.valueOf(Integer.parseInt(parts[1]));
String asName = parts[2];
if (asName.isEmpty()) {
log.error("Illegal AS name in '{}' in {}.", line,
this.geoLite2AsnBlocksIpv4CsvFile.getAbsolutePath());
return lookupResults;
}
while (firstAddressNumber < startIpNum
&& firstAddressNumber != -1L) {
sortedAddressNumbers.remove(firstAddressNumber);
......
......@@ -440,13 +440,14 @@ public class LookupServiceTest {
}
@Test()
public void testLookupGeoLite2AsnBlocksIpv4TooFewFieldsNoAsName() {
public void testLookupGeoLite2AsnBlocksIpv4AsNameEmpty() {
List<String> geoLite2AsnBlocksIpv4Lines = new ArrayList<>();
geoLite2AsnBlocksIpv4Lines.add("network,autonomous_system_number,"
+ "autonomous_system_organization");
geoLite2AsnBlocksIpv4Lines.add("8.8.8.0/24,15169,");
this.assertLookupResult(null, null, geoLite2AsnBlocksIpv4Lines, "8.8.8.8",
null, null, null, null, null, null, null, null);
"us", "United States", "California", "Mountain View", 37.3860f,
-122.0838f, "AS15169", "");
}
@Test()
......
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