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

@curveball/bodyparser

Package Overview
Dependencies
Maintainers
1
Versions
26
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@curveball/bodyparser - npm Package Compare versions

Comparing version 0.2.1 to 0.2.2

6

changelog.md

@@ -0,1 +1,7 @@

0.2.2 (2018-09-05)
==================
* Fixed bug: Body parsing wasn't awaited.
0.2.1 (2018-09-05)

@@ -2,0 +8,0 @@ ==================

14

dist/index.js

@@ -9,3 +9,3 @@ "use strict";

return async (ctx, next) => {
parse(ctx);
await parse(ctx);
return next();

@@ -15,16 +15,14 @@ };

exports.default = bodyParser;
async function parse(ctx) {
function parse(ctx) {
const type = ctx.request.type;
if (type === 'application/json' || /^application\/(.*)\+json$/.test(type)) {
parseJson(ctx);
return;
return parseJson(ctx);
}
if (type === 'application/x-www-form-urlencoded') {
parseUrlEncoded(ctx);
return;
return parseUrlEncoded(ctx);
}
if (type.startsWith('text/')) {
parseText(ctx);
return;
return parseText(ctx);
}
return Promise.resolve();
}

@@ -31,0 +29,0 @@ async function parseJson(ctx) {

{
"name": "@curveball/bodyparser",
"version": "0.2.1",
"version": "0.2.2",
"description": "A curveball middleware for parsing JSON and Text bodies.",

@@ -5,0 +5,0 @@ "main": "dist/index.js",

Sorry, the diff of this file is not supported yet

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