diff --git a/packages/jsts/src/rules/S5693/rule.ts b/packages/jsts/src/rules/S5693/rule.ts index 9c8b22c5701..fe296992c56 100644 --- a/packages/jsts/src/rules/S5693/rule.ts +++ b/packages/jsts/src/rules/S5693/rule.ts @@ -130,6 +130,10 @@ function checkFormidable(context: Rule.RuleContext, callExpression: estree.CallE } function checkMulter(context: Rule.RuleContext, callExpression: estree.CallExpression) { + if (callExpression.callee.type === 'MemberExpression') { + return; + } + if (callExpression.arguments.length === 0) { report(context, callExpression.callee); return; diff --git a/packages/jsts/src/rules/S5693/unit.test.ts b/packages/jsts/src/rules/S5693/unit.test.ts index 3e077ed634d..f8c625d8090 100644 --- a/packages/jsts/src/rules/S5693/unit.test.ts +++ b/packages/jsts/src/rules/S5693/unit.test.ts @@ -38,6 +38,14 @@ ruleTester.run('Allowing requests with excessive content length is security-sens code: ` const multer = require('multer'); const upload = multer(options); + const storage = multer.diskStorage({ + destination: function (req, file, cb) { + cb(null, '/tmp/my-uploads') + }, + filename: function (req, file, cb) { + cb(null, file.fieldname) + } + }); `, options, },