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

njv

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

njv - npm Package Compare versions

Comparing version 1.1.1 to 1.1.2

14

index.js

@@ -30,12 +30,6 @@ /**

/**
* when request body exist
* Judge conten-type
*/
if (req.body) {
if (! ~resContentTypes.indexOf('application/vnd.api+json')) {
return next((0, _buildHttpError2['default'])(415));
} else if (resContentTypes.split(';').length > 1) {
return next((0, _buildHttpError2['default'])(415));
}
/* When body has data, need to validate content type */
var contentLength = req.headers['content-length'];
if (contentLength > 0 && resContentTypes !== 'application/vnd.api+json') {
return next((0, _buildHttpError2['default'])(415));
}

@@ -42,0 +36,0 @@

@@ -19,12 +19,6 @@ /**

/**
* when request body exist
* Judge conten-type
*/
if (req.method === 'POST' || req.method === 'PUT' || req.method === 'PATCH') {
if (!~resContentTypes.indexOf('application/vnd.api+json')) {
return next(httpError(415))
} else if (resContentTypes.split(';').length > 1) {
return next(httpError(415))
}
/* When body has data, need to validate content type */
const contentLength = req.headers['content-length']
if (contentLength > 0 && resContentTypes !== 'application/vnd.api+json') {
return next(httpError(415))
}

@@ -31,0 +25,0 @@

{
"name": "njv",
"version": "1.1.1",
"version": "1.1.2",
"description": "jsonapi validator middleware for node.js",

@@ -5,0 +5,0 @@ "main": "index.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