expf-sigma-node.js 1.1.2 → 1.1.4

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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/public/sigma.js +3 -3
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "expf-sigma-node.js",
3
- "version": "1.1.2",
3
+ "version": "1.1.4",
4
4
  "description": "expf-sigma-node.js lets you manage features flags and remote config across web, server side applications. Deliver true Continuous Integration. Get builds out faster. Control who has access to new features.",
5
5
  "main": "public/sigma.js",
6
6
  "keywords": [
package/public/sigma.js CHANGED
@@ -957,6 +957,7 @@ var Sigma = class {
957
957
  body,
958
958
  credentials: "same-origin",
959
959
  headers: {
960
+ "X-Real-IP": this.userData.ip,
960
961
  token: this.token,
961
962
  "user-id": this.userData.userId ? this.userData.userId : this.sigmaUserData.user.userId
962
963
  }
@@ -996,7 +997,7 @@ var Sigma = class {
996
997
  try {
997
998
  if (!this.userData.geo) {
998
999
  const userGeoData = await this.getUserGeoData();
999
- if (!this.cache.get(sigmaGeoData) || this.cache.get(sigmaGeoData, { location: "none" }) && userGeoData) {
1000
+ if (!this.cache.get(sigmaGeoData) || userGeoData) {
1000
1001
  this.cache.set(sigmaGeoData, JSON.stringify(userGeoData));
1001
1002
  }
1002
1003
  } else {
@@ -1004,7 +1005,6 @@ var Sigma = class {
1004
1005
  }
1005
1006
  } catch (error) {
1006
1007
  this.cache.set(sigmaGeoData, JSON.stringify({ location: "none" }));
1007
- console.error(error);
1008
1008
  }
1009
1009
  let data;
1010
1010
  try {
@@ -1045,7 +1045,7 @@ var Sigma = class {
1045
1045
  this.cache.get("sigmaDataFileLastUpdate")
1046
1046
  );
1047
1047
  const currentTime = Math.floor(Date.now() / 1e3);
1048
- if (currentTime > lastUpdate + this.cacheTTL) {
1048
+ if (currentTime > lastUpdate + this.cacheTTL || this.userData.geo) {
1049
1049
  return true;
1050
1050
  }
1051
1051
  return false;