pino-std-serializers
Advanced tools
Comparing version 3.1.1 to 3.2.0
@@ -25,2 +25,12 @@ 'use strict' | ||
}, | ||
query: { | ||
enumerable: true, | ||
writable: true, | ||
value: '' | ||
}, | ||
params: { | ||
enumerable: true, | ||
writable: true, | ||
value: '' | ||
}, | ||
headers: { | ||
@@ -65,2 +75,4 @@ enumerable: true, | ||
_req.url = req.originalUrl | ||
_req.query = req.query | ||
_req.params = req.params | ||
} else { | ||
@@ -67,0 +79,0 @@ // req.url.path is for hapi compat. |
{ | ||
"name": "pino-std-serializers", | ||
"version": "3.1.1", | ||
"version": "3.2.0", | ||
"description": "A collection of standard object serializers for Pino", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -355,1 +355,41 @@ 'use strict' | ||
}) | ||
test('req.query is available', function (t) { | ||
t.plan(1) | ||
const server = http.createServer(handler) | ||
server.unref() | ||
server.listen(0, () => { | ||
http.get(server.address(), () => {}) | ||
}) | ||
t.tearDown(() => server.close()) | ||
function handler (req, res) { | ||
req.originalUrl = '/test' | ||
req.query = '/foo?bar=foobar&bar=foo' | ||
const serialized = serializers.reqSerializer(req) | ||
t.is(serialized.query, '/foo?bar=foobar&bar=foo') | ||
res.end() | ||
} | ||
}) | ||
test('req.params is available', function (t) { | ||
t.plan(1) | ||
const server = http.createServer(handler) | ||
server.unref() | ||
server.listen(0, () => { | ||
http.get(server.address(), () => {}) | ||
}) | ||
t.tearDown(() => server.close()) | ||
function handler (req, res) { | ||
req.originalUrl = '/test' | ||
req.params = '/foo/bar' | ||
const serialized = serializers.reqSerializer(req) | ||
t.is(serialized.params, '/foo/bar') | ||
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
27352
732