Comparing version 0.18.0 to 0.18.1
@@ -0,1 +1,2 @@ | ||
var http = require('http'); | ||
@@ -2,0 +3,0 @@ var logfmt = require('../logfmt'); |
@@ -8,3 +8,3 @@ var commonFormatter = function(req, res){ | ||
//in express it is an attribute | ||
var path = req.path; | ||
var path = req.path || req.url; | ||
} | ||
@@ -11,0 +11,0 @@ |
{ | ||
"name": "logfmt", | ||
"version": "0.18.0", | ||
"version": "0.18.1", | ||
"description": "key=value logger and parser", | ||
@@ -5,0 +5,0 @@ "main": "logfmt.js", |
@@ -136,2 +136,11 @@ var logfmt = require('../logfmt'), | ||
test("commonFormatter uses correct path w. vanilla http", function(){ | ||
var mockReq = {method: 'GET'} | ||
mockReq.url = '/bar' | ||
mockReq.ip = '1.0.0.1' | ||
var mockRes = {statusCode: 200} | ||
var actual = logfmt.requestLogger.commonFormatter(mockReq, mockRes); | ||
assert.equal('/bar', actual.path); | ||
}) | ||
test("commonFormatter uses correct ip", function(){ | ||
@@ -138,0 +147,0 @@ var mockReq = {method: 'GET'} |
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
54911
1284