Socket
Socket
Sign inDemoInstall

@godaddy/terminus

Package Overview
Dependencies
Maintainers
15
Versions
41
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@godaddy/terminus - npm Package Compare versions

Comparing version 4.6.0 to 4.7.0

21

lib/terminus.js

@@ -37,4 +37,19 @@ 'use strict'

async function sendFailure (res, options) {
const { error, onSendFailureDuringShutdown } = options
const { error, onSendFailureDuringShutdown, exposeStackTraces } = options
function replaceErrors (_, value) {
if (value instanceof Error) {
const error = {}
Object.getOwnPropertyNames(value).forEach(function (key) {
if (exposeStackTraces !== true && key === 'stack') return
error[key] = value[key]
})
return error
}
return value
}
if (onSendFailureDuringShutdown) {

@@ -50,3 +65,3 @@ await onSendFailureDuringShutdown()

details: error
}))
}, replaceErrors))
}

@@ -78,3 +93,3 @@ res.end(FAILURE_RESPONSE)

logger('healthcheck failed', error)
return sendFailure(res, { error: error.causes })
return sendFailure(res, { error: error.causes, exposeStackTraces: healthChecks.__unsafeExposeStackTraces })
}

@@ -81,0 +96,0 @@ return sendSuccess(res, { info, verbatim: healthChecks.verbatim })

2

package.json
{
"name": "@godaddy/terminus",
"version": "4.6.0",
"version": "4.7.0",
"description": "",

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

@@ -56,3 +56,4 @@

'/healthcheck': healthCheck, // a function returning a promise indicating service health,
verbatim: true // [optional = false] use object returned from /healthcheck verbatim in response
verbatim: true, // [optional = false] use object returned from /healthcheck verbatim in response,
__unsafeExposeStackTraces: true // [optional = false] return stack traces in error response if healthchecks throw errors
},

@@ -59,0 +60,0 @@ caseInsensitive, // [optional] whether given health checks routes are case insensitive (defaults to false)

@@ -11,6 +11,5 @@ declare module "@godaddy/terminus" {

export type HealthCheckMap = {
verbatim?: boolean
__unsafeExposeStackTraces?: boolean;
[key: string]: HealthCheck | boolean;
} | {
verbatim: boolean
[key: string]: HealthCheck | boolean;
}

@@ -17,0 +16,0 @@

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