Skip to content

Commit

Permalink
Fix validation to allow https in the fileReference (#468)
Browse files Browse the repository at this point in the history
  • Loading branch information
dynamicbark authored Jun 12, 2023
1 parent 9f845e0 commit a974bc4
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions bot/src/routes/api/admin/SoundsRouter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit a974bc4

Please sign in to comment.