koa-body-parser
Advanced tools
Comparing version 0.1.1 to 0.2.0
25
index.js
@@ -70,6 +70,25 @@ var getRawBody = require('raw-body') | ||
var stream = decoder | ||
? this.req.pipe(decoder) | ||
: this.req | ||
var req = this.req | ||
var stream = req | ||
if (decoder) { | ||
var close = function () { | ||
decoder.close() | ||
cleanup() | ||
} | ||
var cleanup = function () { | ||
req = stream = decoder = null | ||
req.removeListener('end', cleanup) | ||
req.removeListener('error', cleanup) | ||
req.removeListener('close', cleanup) | ||
} | ||
req.once('close', close) | ||
req.once('error', close) | ||
req.once('end', cleanup) | ||
stream = req.pipe(decoder) | ||
} | ||
return yield getRawBody(stream, { | ||
@@ -76,0 +95,0 @@ limit: lim || limit, |
{ | ||
"name": "koa-body-parser", | ||
"description": "Request body parser for koa", | ||
"version": "0.1.1", | ||
"version": "0.2.0", | ||
"author": { | ||
@@ -21,3 +21,3 @@ "name": "Jonathan Ong", | ||
"dependencies": { | ||
"raw-body": "~0.2.0" | ||
"raw-body": "~1.0.1" | ||
}, | ||
@@ -24,0 +24,0 @@ "peerDependencies": { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
7307
80
+ Addedraw-body@1.0.1(transitive)
- Removedraw-body@0.2.0(transitive)
Updatedraw-body@~1.0.1