Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

hmpo-logger

Package Overview
Dependencies
Maintainers
3
Versions
29
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

hmpo-logger - npm Package Compare versions

Comparing version 6.0.0 to 6.1.0

9

lib/logger.js

@@ -181,10 +181,3 @@ const os = require('os');

if (!this.req) { return; }
if (this.req.headers && this.req.headers['x-forwarded-for']) {
const forwardedIP = this.req.headers['x-forwarded-for'];
return forwardedIP.split(',')[0].trim();
}
if (this.req.connection) {
return this.req.connection.remoteAddress;
}
return this.req.ip || (this.req.connection && this.req.connection.remoteAddress);
}),

@@ -191,0 +184,0 @@

2

package.json
{
"name": "hmpo-logger",
"version": "6.0.0",
"version": "6.1.0",
"description": "Consistent logging for hmpo apps",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -512,8 +512,6 @@

it('should return ip from x-forwarded-for', function () {
it('should return ip from the processed request ip', function () {
let context = {
req: {
headers: {
'x-forwarded-for': '5678'
},
ip: '5678',
connection: {

@@ -529,18 +527,2 @@ remoteAddress: '1234'

it('should return ip from x-forwarded-for list', function () {
let context = {
req: {
headers: {
'x-forwarded-for': '5678, 8910'
},
connection: {
remoteAddress: '1234'
}
}
};
Logger.tokens.clientip.fn.call(context)
.should.equal('5678');
});
it('should return undefined for no req', function () {

@@ -547,0 +529,0 @@ expect(Logger.tokens.clientip.fn.call({}))

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc