Comparing version 2.1.0 to 2.2.0
@@ -7,2 +7,3 @@ 'use strict'; | ||
var ip = require('./lib/ip'); | ||
var isGzip = require('./lib/is-gzip'); | ||
var utils = require('./lib/utils'); | ||
@@ -19,2 +20,5 @@ | ||
if (err) return cb(err); | ||
if (isGzip(database)) { | ||
return cb(new Error('Looks like you are passing in a file in gzip format, please use mmdb database instead.')); | ||
} | ||
var reader = new Reader(database, opts); | ||
@@ -21,0 +25,0 @@ if (opts && !!opts.watchForUpdates) { |
{ | ||
"name": "maxmind", | ||
"version": "2.1.0", | ||
"version": "2.2.0", | ||
"homepage": "https://github.com/runk/node-maxmind", | ||
@@ -5,0 +5,0 @@ "description": "IP lookup using Maxmind databases", |
@@ -87,2 +87,11 @@ 'use strict'; | ||
it('should return an error when gzip file attempted', function(done) { | ||
var dbPath = path.join(__dirname, 'databases/GeoIP2-City-Test.mmdb.gz'); | ||
maxmind.open(dbPath, function(err) { | ||
assert.equal(err.message, | ||
'Looks like you are passing in a file in gzip format, please use mmdb database instead.'); | ||
done(); | ||
}); | ||
}); | ||
it('should check for an error when cannot read database on update', function(done) { | ||
@@ -89,0 +98,0 @@ var counter = 0; |
2030775
76
62698