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

koa-body

Package Overview
Dependencies
Maintainers
1
Versions
43
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

koa-body - npm Package Compare versions

Comparing version 1.0.0 to 1.0.1

21

index.js

@@ -44,11 +44,16 @@ /**

var body = {};
if (this.is('json')) {
body = yield buddy.json(this, {encoding: opts.encoding, limit: opts.jsonLimit});
// GET, HEAD, and DELETE requests have no defined semantics for the request body
// (http://tools.ietf.org/html/draft-ietf-httpbis-p2-semantics-19#section-6.3)
// so don't parse the body in those cases.
if (["GET", "HEAD", "DELETE"].indexOf(this.method.toUpperCase()) === -1) {
if (this.is('json')) {
body = yield buddy.json(this, {encoding: opts.encoding, limit: opts.jsonLimit});
}
else if (this.is('urlencoded')) {
body = yield buddy.form(this, {encoding: opts.encoding, limit: opts.formLimit});
}
else if (opts.multipart && this.is('multipart')) {
body = yield formy(this, opts.formidable);
}
}
else if (this.is('urlencoded')) {
body = yield buddy.form(this, {encoding: opts.encoding, limit: opts.formLimit});
}
else if (opts.multipart && this.is('multipart')) {
body = yield formy(this, opts.formidable);
}

@@ -55,0 +60,0 @@ if (opts.patchNode) {

{
"name": "koa-body",
"version": "1.0.0",
"version": "1.0.1",
"description": "A koa body parser middleware. Support multipart, urlencoded and json request bodies.",

@@ -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