From a974bc4eef395931f946591e51721f631018373b Mon Sep 17 00:00:00 2001 From: Sky Walters <79102296+smol-skyz@users.noreply.github.com> Date: Mon, 12 Jun 2023 13:08:19 -0400 Subject: [PATCH] Fix validation to allow https in the fileReference (#468) --- bot/src/routes/api/admin/SoundsRouter.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bot/src/routes/api/admin/SoundsRouter.ts b/bot/src/routes/api/admin/SoundsRouter.ts index 9de3c2bf..1ddb3316 100644 --- a/bot/src/routes/api/admin/SoundsRouter.ts +++ b/bot/src/routes/api/admin/SoundsRouter.ts @@ -33,7 +33,7 @@ soundsRouter.post('/', async (req: Request, res: Response) => { .notEmpty() .bail() .custom((value: string) => { - if (!value.startsWith('./sounds/') && !value.startsWith('http://') && !value.startsWith('http://')) { + if (!value.startsWith('./sounds/') && !value.startsWith('http://') && !value.startsWith('https://')) { throw new Error(); } return true; @@ -183,7 +183,7 @@ soundsRouter.patch( .notEmpty() .bail() .custom((value: string) => { - if (!value.startsWith('./sounds/') && !value.startsWith('http://') && !value.startsWith('http://')) { + if (!value.startsWith('./sounds/') && !value.startsWith('http://') && !value.startsWith('https://')) { throw new Error(); } return true;