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

express-fileupload

Package Overview
Dependencies
Maintainers
2
Versions
49
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

express-fileupload - npm Package Compare versions

Comparing version 1.4.2 to 1.4.3

8

lib/isEligibleRequest.js

@@ -40,2 +40,8 @@ const ACCEPTABLE_CONTENT_TYPE = /^multipart\/[\w'"()+-_?/:=,.]+(?:; ?[\w'"()+-_?/:=,.]*)+$/i;

*/
module.exports = (req) => hasBody(req) && hasAcceptableMethod(req) && hasAcceptableContentType(req);
module.exports = (req) => {
try {
return hasBody(req) && hasAcceptableMethod(req) && hasAcceptableContentType(req);
} catch (e) {
return false;
}
};

2

package.json
{
"name": "express-fileupload",
"version": "1.4.2",
"version": "1.4.3",
"author": "Richard Girges <richardgirges@gmail.com>",

@@ -5,0 +5,0 @@ "description": "Simple express file upload middleware that wraps around Busboy",

@@ -116,2 +116,14 @@ 'use strict';

});
it('should return false if the request is empty or not provided', () => {
const result = isEligibleRequest();
assert.equal(result, false);
});
it('should return false if content-type is not specified.', () => {
const req = {
method: 'POST',
headers: { 'content-length': '768751' }
};
const result = isEligibleRequest(req);
assert.equal(result, false);
});
});
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