Skip to content
Browse files

geoip: handle "geoip-lite" sort of loaded, but not really

  • Loading branch information...
1 parent 856db9b commit 70a5429a0401ad7e1e94eaebbec01420d33e7a03 @msimerson msimerson committed Jun 26, 2014
Showing with 6 additions and 0 deletions.
  1. +6 −0 plugins/connect.geoip.js
View
6 plugins/connect.geoip.js
@@ -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();

0 comments on commit 70a5429

Please sign in to comment.
Something went wrong with that request. Please try again.