Skip to content

Commit

Permalink
geoip: handle "geoip-lite" sort of loaded, but not really
Browse files Browse the repository at this point in the history
  • Loading branch information
msimerson committed Jun 27, 2014
1 parent 856db9b commit 70a5429
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions plugins/connect.geoip.js
Expand Up @@ -24,6 +24,12 @@ exports.geoip_lookup = function (next, connection) {
// city: 'San Francisco',
// ll: [37.7484, -122.4156]

if (!plugin.geoip) {
// geoip-lite dropped node 0.8 support
connection.results.add(plugin, {err: "geoip-lite not loaded!"});
return next();
}

var r = plugin.geoip.lookup(connection.remote_ip);
if (!r) return next();

Expand Down

0 comments on commit 70a5429

Please sign in to comment.