@newstudios/http-utils
Advanced tools
Comparing version 1.0.6 to 1.0.8
@@ -134,3 +134,9 @@ "use strict"; | ||
if (!ip) { | ||
ip = req[IP] = getIps(req)[0] || (req.socket && req.socket.remoteAddress) || ''; | ||
// nextjs not mocked remote address | ||
try { | ||
ip = req[IP] = getIps(req)[0] || (req.socket && req.socket.remoteAddress) || ''; | ||
} | ||
catch { | ||
ip = ''; | ||
} | ||
} | ||
@@ -137,0 +143,0 @@ return ip; |
{ | ||
"name": "@newstudios/http-utils", | ||
"version": "1.0.6", | ||
"version": "1.0.8", | ||
"description": "http common lib", | ||
@@ -10,3 +10,3 @@ "main": "dist/index.js", | ||
"build": "npm run clean && tsc", | ||
"prepublishOnly": "npm build" | ||
"prepublishOnly": "npm run build" | ||
}, | ||
@@ -13,0 +13,0 @@ "dependencies": { |
@@ -147,3 +147,8 @@ import { CookieSerializeOptions, serialize, parse } from 'cookie' | ||
if (!ip) { | ||
ip = req[IP] = getIps(req)[0] || (req.socket && req.socket.remoteAddress) || '' | ||
// nextjs not mocked remote address | ||
try { | ||
ip = req[IP] = getIps(req)[0] || (req.socket && req.socket.remoteAddress) || '' | ||
} catch { | ||
ip = '' | ||
} | ||
} | ||
@@ -150,0 +155,0 @@ return ip |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
24337
556