Closed
Description
Issue Description
When calling a cloud code function via REST API and passing a parameter without value, should the request parameter be undefined in Cloud Code?
Steps to reproduce
- Create a Cloud Code function:
Parse.Cloud.define("checkP", function(request, response) {
var p = request.params.p;
if (p === undefined) {
response.error("p not set");
return;
}
response.success();
}
- Call the function using the REST API and pass the parameter
p
without value.
Expected Results
Cloud code should execute response.error("p not set");
Actual Outcome
Cloud code executes response.success();
So a double check is necessary in Cloud Code to account for value-less parameters:
if (p === undefined || p == "") {...}
Environment Setup
- Server
- parse-server version (Be specific! Don't say 'latest'.) : 2.5.3
- calling REST API with postman, setting parameter key
p
without value - Localhost or remote server? (AWS, Heroku, Azure, Digital Ocean, etc): Heroku
Metadata
Metadata
Assignees
Labels
No labels