Socket
Socket
Sign inDemoInstall

middy

Package Overview
Dependencies
12
Maintainers
8
Versions
147
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 0.23.0 to 0.24.0

2

package.json
{
"name": "middy",
"version": "0.23.0",
"version": "0.24.0",
"description": "🛵 The stylish Node.js middleware engine for AWS Lambda",

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

@@ -141,2 +141,8 @@ const middy = require('../../middy')

handler.use({
onError: (handler, next) => {
next()
}
})
const event = {

@@ -155,2 +161,17 @@ httpMethod: 'GET'

test('It should not swallow errors', () => {
const handler = middy((event, context, cb) => {
throw new Error('some-error')
})
handler.use(
cors()
)
handler({}, {}, (error, response) => {
expect(response).toBe(undefined)
expect(error.message).toEqual('some-error')
})
})
test('It should not override already declared Access-Control-Allow-Headers header', () => {

@@ -175,2 +196,7 @@ const handler = middy((event, context, cb) => {

}))
handler.use({
onError: (handler, next) => {
next()
}
})

@@ -237,2 +263,7 @@ const event = {

)
handler.use({
onError: (handler, next) => {
next()
}
})

@@ -274,2 +305,7 @@ const event = {

)
handler.use({
onError: (handler, next) => {
next()
}
})

@@ -276,0 +312,0 @@ const event = {

@@ -50,3 +50,3 @@ const defaults = {

next()
next(handler.error)
}

@@ -53,0 +53,0 @@

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc