Comparing version 3.0.0 to 3.0.1
@@ -124,3 +124,3 @@ 'use strict' | ||
const _req = Object.create(pinoReqProto) | ||
_req.id = req.id | ||
_req.id = typeof req.id === 'function' ? req.id() : req.id | ||
_req.method = req.method | ||
@@ -127,0 +127,0 @@ _req.url = req.url |
{ | ||
"name": "pino-http", | ||
"version": "3.0.0", | ||
"version": "3.0.1", | ||
"description": "High-speed HTTP logger for Node.js", | ||
@@ -5,0 +5,0 @@ "main": "logger.js", |
37
test.js
@@ -324,4 +324,3 @@ 'use strict' | ||
server.listen(0, () => { | ||
const port = server.address().port | ||
http.get(`http://127.0.0.1:${port}`, () => {}) | ||
http.get(server.address(), () => {}) | ||
}) | ||
@@ -356,4 +355,3 @@ | ||
server.listen(0, () => { | ||
const port = server.address().port | ||
http.get(`http://127.0.0.1:${port}`, () => {}) | ||
http.get(server.address(), () => {}) | ||
}) | ||
@@ -384,4 +382,3 @@ | ||
server.listen(0, () => { | ||
const port = server.address().port | ||
http.get(`http://127.0.0.1:${port}`, () => {}) | ||
http.get(server.address(), () => {}) | ||
}) | ||
@@ -411,4 +408,3 @@ | ||
server.listen(0, () => { | ||
const port = server.address().port | ||
http.get(`http://127.0.0.1:${port}`, () => {}) | ||
http.get(server.address(), () => {}) | ||
}) | ||
@@ -421,1 +417,26 @@ | ||
}) | ||
test('req.id has a non-function value', function (t) { | ||
t.plan(1) | ||
var dest = split(JSON.parse) | ||
var logger = pinoHttp({ | ||
logger: pino(dest), | ||
serializers: { | ||
req: function (req) { | ||
t.is(typeof req.id === 'function', false) | ||
return req | ||
} | ||
} | ||
}) | ||
var server = http.createServer(handler) | ||
server.unref() | ||
server.listen(0, () => { | ||
http.get(server.address(), () => {}) | ||
}) | ||
function handler (req, res) { | ||
logger(req, res) | ||
res.end() | ||
} | ||
}) |
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
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
25234
621
9