Socket
Socket
Sign inDemoInstall

co-body

Package Overview
Dependencies
Maintainers
3
Versions
21
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

co-body - npm Package Compare versions

Comparing version 4.1.0 to 4.2.0

6

History.md
4.2.0 / 2016-05-05
==================
* test: test on node 4, 5, 6
* feat: Added support for request body inflation
4.1.0 / 2016-05-05

@@ -3,0 +9,0 @@ ==================

6

lib/form.js

@@ -7,2 +7,3 @@

var raw = require('raw-body');
var inflate = require('inflation');
var qs = require('qs');

@@ -28,3 +29,4 @@

var len = req.headers['content-length'];
if (len) opts.length = ~~len;
var encoding = req.headers['content-encoding'] || 'identity';
if (len && encoding === 'identity') opts.length = ~~len;
opts.encoding = opts.encoding || 'utf8';

@@ -35,3 +37,3 @@ opts.limit = opts.limit || '56kb';

// raw-body returns a Promise when no callback is specified
return raw(req, opts)
return raw(inflate(req), opts)
.then(function(str){

@@ -38,0 +40,0 @@ try {

@@ -7,2 +7,3 @@

var raw = require('raw-body');
var inflate = require('inflation');

@@ -31,3 +32,4 @@ // Allowed whitespace is defined in RFC 7159

var len = req.headers['content-length'];
if (len) opts.length = len = ~~len;
var encoding = req.headers['content-encoding'] || 'identity';
if (len && encoding === 'identity') opts.length = len = ~~len;
opts.encoding = opts.encoding || 'utf8';

@@ -38,3 +40,3 @@ opts.limit = opts.limit || '1mb';

// raw-body returns a promise when no callback is specified
return raw(req, opts)
return raw(inflate(req), opts)
.then(function(str) {

@@ -41,0 +43,0 @@ try {

@@ -6,2 +6,3 @@ /**

var raw = require('raw-body');
var inflate = require('inflation');

@@ -26,3 +27,4 @@ /**

var len = req.headers['content-length'];
if (len) opts.length = ~~len;
var encoding = req.headers['content-encoding'] || 'identity';
if (len && encoding === 'identity') opts.length = ~~len;
opts.encoding = opts.encoding || 'utf8';

@@ -32,3 +34,3 @@ opts.limit = opts.limit || '1mb';

// raw-body returns a Promise when no callback is specified
return raw(req, opts);
return raw(inflate(req), opts);
};
{
"name": "co-body",
"version": "4.1.0",
"version": "4.2.0",
"repository": "cojs/co-body",

@@ -18,2 +18,3 @@ "description": "request body parsing for co",

"raw-body": "~2.1.2",
"inflation": "~2.0.0",
"type-is": "~1.6.6"

@@ -20,0 +21,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