Improve data validation for channel names
This commit is contained in:
parent
adf3cdf771
commit
29e7e2a297
5 changed files with 19 additions and 5 deletions
|
|
@ -1,4 +1,5 @@
|
|||
import { anonymizePhrase, convertToKey, spacePhrase } from "$/utils/game";
|
||||
import { channelSchema } from "$/schemas/general";
|
||||
import { config, database } from "$/main";
|
||||
import { ServerRoute } from "@hapi/hapi";
|
||||
import { readFileSync } from "fs";
|
||||
|
|
@ -10,7 +11,7 @@ const route: ServerRoute = {
|
|||
options: {
|
||||
validate: {
|
||||
params: Joi.object({
|
||||
channel: Joi.string().alphanum(),
|
||||
channel: channelSchema,
|
||||
}),
|
||||
query: Joi.object({
|
||||
word_list: Joi.string(),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue