Skip to content

Commit e11d208

Browse files
ItsJimivmarchaud
authored andcommitted
validator: check args length for POST, PUT and PATCH
1 parent 264a44e commit e11d208

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/utils/validator.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,8 @@ module.exports = class RequestValidator {
7474
httpOpts.url = httpOpts.url.replace(param.name, param.defaultvalue)
7575
}
7676
}
77+
// if we don't have any arguments, break
78+
if (args.length === 0) break
7779
let data = args[0]
7880
if (typeof data !== 'object' && endpoint.body.length > 0) {
7981
return reject(new Error(`Expected to receive an object for post data but received ${typeof data}`))

0 commit comments

Comments
 (0)