securenow 5.12.0 → 5.12.1
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/cli.js +1 -1
- package/firewall.js +4 -3
- package/package.json +1 -1
package/cli.js
CHANGED
package/firewall.js
CHANGED
|
@@ -11,6 +11,7 @@ let _syncTimer = null;
|
|
|
11
11
|
let _versionTimer = null;
|
|
12
12
|
let _lastModified = null;
|
|
13
13
|
let _lastVersion = null;
|
|
14
|
+
let _lastSyncEtag = null;
|
|
14
15
|
let _initialized = false;
|
|
15
16
|
let _consecutiveErrors = 0;
|
|
16
17
|
let _layers = [];
|
|
@@ -40,8 +41,8 @@ function syncBlocklist(callback) {
|
|
|
40
41
|
timeout: 10000,
|
|
41
42
|
};
|
|
42
43
|
|
|
43
|
-
if (
|
|
44
|
-
reqOptions.headers['If-None-Match'] =
|
|
44
|
+
if (_lastSyncEtag) {
|
|
45
|
+
reqOptions.headers['If-None-Match'] = _lastSyncEtag;
|
|
45
46
|
} else if (_lastModified) {
|
|
46
47
|
reqOptions.headers['If-Modified-Since'] = _lastModified;
|
|
47
48
|
}
|
|
@@ -65,7 +66,7 @@ function syncBlocklist(callback) {
|
|
|
65
66
|
_rawIps = ips;
|
|
66
67
|
_matcher = createMatcher(ips);
|
|
67
68
|
_lastModified = res.headers['last-modified'] || null;
|
|
68
|
-
if (res.headers['etag'])
|
|
69
|
+
if (res.headers['etag']) _lastSyncEtag = res.headers['etag'];
|
|
69
70
|
_stats.syncs++;
|
|
70
71
|
notifyLayers(ips);
|
|
71
72
|
callback(null, true, _matcher.stats());
|
package/package.json
CHANGED