geoip-lite
Advanced tools
Comparing version 1.1.7 to 1.1.8
@@ -205,2 +205,14 @@ var fs = require('fs'); | ||
function get4mapped(ip) { | ||
var ipv6 = ip.toUpperCase(); | ||
var v6prefixes = ['0:0:0:0:0:FFFF:', '::FFFF:']; | ||
for (var i = 0; i < v6prefixes.length; i++) { | ||
var v6prefix = v6prefixes[i]; | ||
if (ipv6.indexOf(v6prefix) == 0) { | ||
return ipv6.substring(v6prefix.length); | ||
} | ||
} | ||
return null; | ||
} | ||
function preload(callback) { | ||
@@ -453,3 +465,8 @@ var datFile; | ||
} else if (net.isIP(ip) === 6) { | ||
return lookup6(utils.aton6(ip)); | ||
var ipv4 = get4mapped(ip); | ||
if (ipv4) { | ||
return lookup4(utils.aton4(ipv4)); | ||
} else { | ||
return lookup6(utils.aton6(ip)); | ||
} | ||
} | ||
@@ -456,0 +473,0 @@ |
{ | ||
"name" : "geoip-lite", | ||
"version" : "1.1.7", | ||
"version" : "1.1.8", | ||
"description" : "A light weight native JavaScript implementation of GeoIP API from MaxMind", | ||
@@ -18,9 +18,9 @@ "keywords" : ["geo", "geoip", "ip", "ipv4", "ipv6", "geolookup", "maxmind", "geolite"], | ||
"dependencies": { | ||
"async": "~1.3.0", | ||
"colors": "0.6.0-1", | ||
"glob": "~3.2.1", | ||
"iconv-lite": "~0.4.7", | ||
"async": "~1.5.2", | ||
"colors": "1.1.2", | ||
"glob": "~7.0.3", | ||
"iconv-lite": "~0.4.13", | ||
"lazy": "~1.0.11", | ||
"rimraf": "~2.0.2", | ||
"unzip": "~0.0.4" | ||
"rimraf": "~2.5.2", | ||
"unzip": "~0.1.11" | ||
}, | ||
@@ -27,0 +27,0 @@ "config": { |
@@ -43,3 +43,14 @@ var geoip = require('../lib/geoip'); | ||
test.done(); | ||
}, | ||
testIPv4MappedIPv6: function (test) { | ||
test.expect(2); | ||
var actual = geoip.lookup("::ffff:173.185.182.82"); | ||
test.equal(actual.city, "Glen Rose"); | ||
test.equal(actual.metro, 623); | ||
test.done(); | ||
} | ||
}; |
Unidentified License
License(Experimental) Something that seems like a license was found, but its contents could not be matched with a known license.
Found 1 instance in 1 package
76052293
14
1042
1
80
+ Addedasync@1.5.2(transitive)
+ Addedbalanced-match@1.0.2(transitive)
+ Addedbrace-expansion@1.1.11(transitive)
+ Addedcolors@1.1.2(transitive)
+ Addedconcat-map@0.0.1(transitive)
+ Addedcore-util-is@1.0.3(transitive)
+ Addedfs.realpath@1.0.0(transitive)
+ Addedglob@7.0.6(transitive)
+ Addedinflight@1.0.6(transitive)
+ Addedisarray@0.0.1(transitive)
+ Addedmatch-stream@0.0.2(transitive)
+ Addedminimatch@3.1.2(transitive)
+ Addedonce@1.4.0(transitive)
+ Addedpath-is-absolute@1.0.1(transitive)
+ Addedpullstream@0.4.1(transitive)
+ Addedreadable-stream@1.0.34(transitive)
+ Addedrimraf@2.5.4(transitive)
+ Addedsetimmediate@1.0.5(transitive)
+ Addedslice-stream@1.0.0(transitive)
+ Addedstring_decoder@0.10.31(transitive)
+ Addedunzip@0.1.11(transitive)
+ Addedwrappy@1.0.2(transitive)
- Removedasync@1.3.0(transitive)
- Removedcolors@0.6.0-1(transitive)
- Removedglob@3.2.11(transitive)
- Removedgraceful-fs@1.1.14(transitive)
- Removedlru-cache@2.7.3(transitive)
- Removedminimatch@0.3.0(transitive)
- Removedpullstream@0.0.4(transitive)
- Removedrimraf@2.0.3(transitive)
- Removedsigmund@1.0.1(transitive)
- Removedstream-buffers@0.2.6(transitive)
- Removedunzip@0.0.4(transitive)
Updatedasync@~1.5.2
Updatedcolors@1.1.2
Updatedglob@~7.0.3
Updatediconv-lite@~0.4.13
Updatedrimraf@~2.5.2
Updatedunzip@~0.1.11