New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

take-five

Package Overview
Dependencies
Maintainers
5
Versions
15
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

take-five - npm Package Compare versions

Comparing version 1.3.5 to 1.4.0

7

lib/parse-body.js

@@ -6,2 +6,3 @@ const Buffer = require('buffer').Buffer

const conlen = parseInt(req.headers['content-length'], 10) || 0
const type = req.headers['content-type']
if (conlen === 0) {

@@ -23,8 +24,10 @@ return next()

const data = body.join('')
if (data) {
if (data && type === 'application/json') {
try {
req.body = JSON.parse(body.join(''))
req.body = JSON.parse(data)
} catch (err) {
return res.err(400, 'Payload is not valid JSON')
}
} else {
req.body = data
}

@@ -31,0 +34,0 @@ next()

@@ -0,1 +1,3 @@

const multipart = /^multipart\/form-data/
module.exports = function (maxSize) {

@@ -6,3 +8,4 @@ return function restrictPost (req, res, next) {

const size = req.headers['content-length']
if (type !== 'application/json') {
if (type !== 'application/json' && !multipart.test(type)) {
return res.err(415, `POST requests must be application/json not ${type}`)

@@ -9,0 +12,0 @@ }

{
"name": "take-five",
"version": "1.3.5",
"version": "1.4.0",
"description": "Very minimal JSON-REST server",

@@ -5,0 +5,0 @@ "main": "take-five.js",

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