appolo-agent
Advanced tools
Comparing version 6.0.18 to 6.0.19
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
const _ = require("lodash"); | ||
class Util { | ||
@@ -18,3 +17,3 @@ static parseUrlFast(str) { | ||
let ipAddress = req.headers['x-client-ip'] || req.headers['x-forwarded-for'] || req.headers['x-real-ip'] || null; | ||
return _.isArray(ipAddress) ? ipAddress : ipAddress.split(','); | ||
return ipAddress ? ipAddress.split(',') : null; | ||
} | ||
@@ -21,0 +20,0 @@ static detectIpFromConnectionOrSocket(req) { |
import http = require('http'); | ||
import _ = require('lodash'); | ||
@@ -19,5 +18,5 @@ export class Util { | ||
public static detectIpFromHeaders(req: http.IncomingMessage): string[] { | ||
let ipAddress = req.headers['x-client-ip'] || req.headers['x-forwarded-for'] || req.headers['x-real-ip'] || null; | ||
let ipAddress = req.headers['x-client-ip'] as string || req.headers['x-forwarded-for'] as string || req.headers['x-real-ip'] as string || null; | ||
return _.isArray(ipAddress) ? ipAddress : ipAddress.split(',') | ||
return ipAddress ? ipAddress.split(',') : null | ||
@@ -24,0 +23,0 @@ } |
@@ -27,3 +27,3 @@ { | ||
"main": "./index.js", | ||
"version": "6.0.18", | ||
"version": "6.0.19", | ||
"license": "MIT", | ||
@@ -30,0 +30,0 @@ "repository": { |
Sorry, the diff of this file is not supported yet
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
83298
1382