aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/main.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/main.cpp b/src/main.cpp
index 58d5791..daa9a09 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -42,6 +42,9 @@ int main() {
if (!data)
return crow::response(400);
+ if (!data.count("command"))
+ return crow::response(400, "malformed request: missing `command` field\n");
+
std::string command = (data.count("command") ? data["command"].s() : NO_SUCH_COMMAND);
std::string arguments = (data.count("arguments") ? data["arguments"].s() : EMPTY_STRING);
std::string session = (data.count("session") ? data["session"].s() : NULL_STRING);