Skip to content

Commit

Permalink
fix: IP location and AS lookup
Browse files Browse the repository at this point in the history
  • Loading branch information
JuliusHenke committed Nov 26, 2023
1 parent 73b9410 commit 1ba7231
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions backend/src/main/kotlin/org/tormap/service/IpLookupService.kt
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,7 @@ class IpLookupService(
fun lookupLocation(ipAddress: String): Location? = try {
if (isValidPublicIPAddress(ipAddress)) {
Location(dbipLocationDB.city(InetAddress.getByName(ipAddress)))
}
null
} else null
} catch (exception: Exception) {
logger.debug("Location lookup for IP $ipAddress failed! ${exception.javaClass}: ${exception.message}")
null
Expand All @@ -41,8 +40,7 @@ class IpLookupService(
fun lookupAutonomousSystem(ipAddress: String): AsnResponse? = try {
if (isValidPublicIPAddress(ipAddress)) {
maxmindAutonomousSystemDB.asn(InetAddress.getByName(ipAddress))
}
null
} else null
} catch (exception: Exception) {
logger.debug("Autonomous System lookup for IP $ipAddress failed! ${exception.javaClass}: ${exception.message}")
null
Expand Down

0 comments on commit 1ba7231

Please sign in to comment.