From 111cb106d0b15bc7277af262ad903d1cea9a33a4 Mon Sep 17 00:00:00 2001 From: Zaid Abdulla Date: Tue, 23 Feb 2021 13:31:32 -0800 Subject: [PATCH] Validate task name in API --- lib/api-functions.ts | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/lib/api-functions.ts b/lib/api-functions.ts index df8a414..7fdbbda 100644 --- a/lib/api-functions.ts +++ b/lib/api-functions.ts @@ -296,6 +296,15 @@ function sanitizeTask(task): void { ) throw new Error("Invalid 'provisions' property"); break; + + case "reboot": + break; + + case "factoryReset": + break; + + default: + throw new Error("Invalid task name"); } return task;