geoip-country 4.2.72 → 4.2.74
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/data/geoip-country.dat +0 -0
- package/data/geoip-country6.dat +0 -0
- package/package.json +1 -1
- package/scripts/updatedb.js +5 -3
package/data/geoip-country.dat
CHANGED
|
Binary file
|
package/data/geoip-country6.dat
CHANGED
|
Binary file
|
package/package.json
CHANGED
package/scripts/updatedb.js
CHANGED
|
@@ -145,8 +145,8 @@ function fetch(database, cb) {
|
|
|
145
145
|
|
|
146
146
|
console.log('Fetching edition ' + database.edition + ' from ' + download_server);
|
|
147
147
|
|
|
148
|
-
function getOptions() {
|
|
149
|
-
var options = url.parse(downloadUrl);
|
|
148
|
+
function getOptions(redirectUrl) {
|
|
149
|
+
var options = url.parse(redirectUrl || downloadUrl);
|
|
150
150
|
options.headers = {
|
|
151
151
|
'User-Agent': user_agent
|
|
152
152
|
};
|
|
@@ -168,7 +168,9 @@ function fetch(database, cb) {
|
|
|
168
168
|
function onResponse(response) {
|
|
169
169
|
var status = response.statusCode;
|
|
170
170
|
|
|
171
|
-
if (status
|
|
171
|
+
if (status === 301 || status === 302 || status === 303 || status === 307 || status === 308) {
|
|
172
|
+
return https.get(getOptions(response.headers.location), onResponse);
|
|
173
|
+
} else if (status !== 200) {
|
|
172
174
|
if (status === 401) {
|
|
173
175
|
console.log('ERROR' + ': Download Not Allowed — Is Your License Key Valid? [HTTP %d]', status);
|
|
174
176
|
} else {
|