not-node 6.5.59 → 6.5.60

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/src/common.js +6 -3
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "not-node",
3
- "version": "6.5.59",
3
+ "version": "6.5.60",
4
4
  "description": "node complimentary part for client side notFramework.",
5
5
  "main": "index.js",
6
6
  "scripts": {
package/src/common.js CHANGED
@@ -342,14 +342,17 @@ module.exports.generatePaths = (content = [], relative = "src") => {
342
342
  **/
343
343
  module.exports.getIP = (req) => {
344
344
  if (req) {
345
- return (
345
+ const ip =
346
346
  (req.headers && req.headers["x-forwarded-for"]) ||
347
347
  (req.connection && req.connection.remoteAddress) ||
348
348
  (req.socket && req.socket.remoteAddress) ||
349
349
  (req.connection &&
350
350
  req.connection.socket &&
351
- req.connection.socket.remoteAddress)
352
- );
351
+ req.connection.socket.remoteAddress);
352
+ if (ip && ip.indexOf(",") > -1) {
353
+ return ip.split(",")[0];
354
+ }
355
+ return ip;
353
356
  } else {
354
357
  return undefined;
355
358
  }