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

pino-http

Package Overview
Dependencies
Maintainers
2
Versions
80
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

pino-http - npm Package Compare versions

Comparing version 2.4.0 to 2.4.1

15

logger.js

@@ -27,3 +27,3 @@ 'use strict'

function onResFinished (err, msg) {
function onResFinished (err) {
this.removeListener('finish', onResFinished)

@@ -47,3 +47,3 @@ this.removeListener('error', onResFinished)

responseTime: responseTime
}, 'request ' + (msg || 'completed'))
}, 'request completed')
}

@@ -53,11 +53,4 @@

var res = this.res
onResFinished.call(res, null, 'aborted')
}
function onReqTimeout () {
this.removeListener('aborted', onReqAborted)
var res = this.res
res.statusCode = 408
onResFinished.call(res, new Error('Timeout'))
onResFinished.call(res, new Error('Aborted'))
}

@@ -73,4 +66,4 @@

res.on('error', onResFinished)
// it's possible that browser aborts connection, or http-server because of timeout
req.on('aborted', onReqAborted)
req.socket.on('timeout', onReqTimeout.bind(req))

@@ -77,0 +70,0 @@ if (next) {

{
"name": "pino-http",
"version": "2.4.0",
"version": "2.4.1",
"description": "High-speed HTTP logger for Node.js",
"main": "logger.js",
"dependencies": {
"pino": "^3.3.2"
"pino": "^3.0.1"
},

@@ -9,0 +9,0 @@ "devDependencies": {

@@ -294,3 +294,5 @@ 'use strict'

dest.on('data', function (line) {
t.equal(line.msg, 'request aborted', 'message is set')
t.equal(line.msg, 'request errored', 'message is set')
t.equal(line.err.message, 'Aborted', 'error message is set')
t.equal(line.res.statusCode, 408, 'statusCode is 408')
t.end()

@@ -300,3 +302,3 @@ })

test('react on timeout event from server', function (t) {
test('react on aborted event from server', function (t) {
var dest = split(JSON.parse)

@@ -328,3 +330,3 @@

t.equal(line.msg, 'request errored', 'message is set')
t.equal(line.err.message, 'Timeout', 'error message is set')
t.equal(line.err.message, 'Aborted', 'error message is set')
t.equal(line.res.statusCode, 408, 'statusCode is 408')

@@ -331,0 +333,0 @@ t.end()

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