From f0f16fecfc74a5b872118321ef21a487e6f907fa Mon Sep 17 00:00:00 2001 From: Gregory Oschwald Date: Tue, 24 Dec 2019 15:37:07 -0800 Subject: [PATCH] Add support for some DBIP databases --- reader.go | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/reader.go b/reader.go index ec333c8..4d9b3ce 100644 --- a/reader.go +++ b/reader.go @@ -275,7 +275,11 @@ func getDBType(reader *maxminddb.Reader) (databaseType, error) { case "GeoLite2-ASN": return isASN, nil // We allow City lookups on Country for back compat - case "GeoLite2-City", + case "DBIP-City-Lite", + "DBIP-City", + "DBIP-Country-Lite", + "DBIP-Country", + "GeoLite2-City", "GeoIP2-City", "GeoIP2-City-Africa", "GeoIP2-City-Asia-Pacific", @@ -290,9 +294,11 @@ func getDBType(reader *maxminddb.Reader) (databaseType, error) { return isConnectionType, nil case "GeoIP2-Domain": return isDomain, nil - case "GeoIP2-Enterprise": + case "DBIP-Location-ISP (compat=Enterprise)", + "GeoIP2-Enterprise": return isEnterprise | isCity | isCountry, nil - case "GeoIP2-ISP", "GeoIP2-Precision-ISP": + case "GeoIP2-ISP", + "GeoIP2-Precision-ISP": return isISP | isASN, nil default: return 0, UnknownDatabaseTypeError{reader.Metadata.DatabaseType}