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

express-openapi-validator

Package Overview
Dependencies
Maintainers
1
Versions
281
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

express-openapi-validator - npm Package Compare versions

Comparing version 0.52.4 to 0.53.1

46

dist/middlewares/openapi.multipart.js

@@ -14,24 +14,11 @@ "use strict";

if (err) {
if (err instanceof multer.MulterError) {
// TODO is special handling for MulterErrors needed
console.error(err);
next(errors_1.validationError(500, req.path, err.message));
}
else {
// HACK
// TODO improve multer error handling
const missingField = /Multipart: Boundary not found/i.test(err.message || '');
if (missingField) {
next(errors_1.validationError(400, req.path, 'multipart file(s) required.'));
}
else {
console.error(err);
next(errors_1.validationError(500, req.path, err.message));
}
}
next(error(req, err));
}
else {
(req.files || []).forEach(f => {
req.body[f.fieldname] = '';
});
if (req.files) {
// add files to body
req.files.forEach(f => {
req.body[f.fieldname] = '';
});
}
next();

@@ -58,2 +45,21 @@ }

}
function error(req, err) {
if (err instanceof multer.MulterError) {
// TODO is special handling for MulterErrors needed
console.error(err);
return errors_1.validationError(500, req.path, err.message);
}
else {
// HACK
// TODO improve multer error handling
const missingField = /Multipart: Boundary not found/i.test(err.message || '');
if (missingField) {
return errors_1.validationError(400, req.path, 'multipart file(s) required.');
}
else {
console.error(err);
return errors_1.validationError(500, req.path, err.message);
}
}
}
//# sourceMappingURL=openapi.multipart.js.map
{
"name": "express-openapi-validator",
"version": "0.52.4",
"version": "0.53.1",
"description": "",

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