Socket
Socket
Sign inDemoInstall

middy

Package Overview
Dependencies
37
Maintainers
8
Versions
147
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 0.18.1 to 0.19.0

2

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

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

const createError = require('http-errors')
const contentType = require('content-type')
const contentTypeLib = require('content-type')
module.exports = () => ({
before: (handler, next) => {
if (handler.event.headers && handler.event.headers['Content-Type']) {
const { type } = contentType.parse(handler.event.headers['Content-Type'])
const { headers } = handler.event
if (!headers) {
return next()
}
const contentType = headers['Content-Type'] || headers['content-type']
if (contentType) {
const { type } = contentTypeLib.parse(contentType)
if (type === 'application/json') {

@@ -9,0 +14,0 @@ try {

SocketSocket SOC 2 Logo

Product

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

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc