Skip to content

Commit

Permalink
Add support for some DBIP databases
Browse files Browse the repository at this point in the history
  • Loading branch information
oschwald committed Dec 24, 2019
1 parent 5cb0648 commit f0f16fe
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions reader.go
Expand Up @@ -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",
Expand All @@ -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}
Expand Down

0 comments on commit f0f16fe

Please sign in to comment.