mirror of
https://github.com/monkeytypegame/monkeytype.git
synced 2025-02-28 08:43:07 +08:00
stricter schemas
This commit is contained in:
parent
6e1e2c6e8f
commit
93c14d6728
1 changed files with 7 additions and 3 deletions
|
@ -254,7 +254,7 @@ router.delete(
|
|||
RateLimit.userCustomFilterRemove,
|
||||
validateRequest({
|
||||
params: {
|
||||
presetId: joi.string().required(),
|
||||
presetId: joi.string().token().required(),
|
||||
},
|
||||
}),
|
||||
asyncHandler(UserController.removeResultFilterPreset)
|
||||
|
@ -501,10 +501,14 @@ router.get(
|
|||
withApeRateLimiter(RateLimit.userProfileGet),
|
||||
validateRequest({
|
||||
params: {
|
||||
uidOrName: joi.string().required(),
|
||||
uidOrName: joi
|
||||
.alternatives()
|
||||
.try(usernameValidation, joi.string().token().max(50)),
|
||||
},
|
||||
query: {
|
||||
isUid: joi.string().allow(""),
|
||||
isUid: joi.string().valid("").messages({
|
||||
"any.only": "isUid must be empty",
|
||||
}),
|
||||
},
|
||||
}),
|
||||
asyncHandler(UserController.getProfile)
|
||||
|
|
Loading…
Reference in a new issue