express-fileupload
Advanced tools
Comparing version 1.4.2 to 1.4.3
@@ -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; | ||
} | ||
}; |
{ | ||
"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); | ||
}); | ||
}); |
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
112457
2604