mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2024-11-25 03:06:31 -05:00
fix: use joi positive, integer and max validators on PORT
validate PORT with the positive, integer and max validators of Joi. See also: - https://joi.dev/api/#numberpositive - https://joi.dev/api/#numberinteger - https://joi.dev/api/#numbermax Signed-off-by: Philip Molares <philip.molares@udo.edu>
This commit is contained in:
parent
0a778d8a64
commit
151e12a8a7
1 changed files with 7 additions and 1 deletions
|
@ -29,7 +29,13 @@ const schema = Joi.object({
|
|||
.default(Joi.ref('domain'))
|
||||
.optional()
|
||||
.label('HD_RENDERER_ORIGIN'),
|
||||
port: Joi.number().default(3000).optional().label('PORT'),
|
||||
port: Joi.number()
|
||||
.positive()
|
||||
.integer()
|
||||
.default(3000)
|
||||
.max(65535)
|
||||
.optional()
|
||||
.label('PORT'),
|
||||
loglevel: Joi.string()
|
||||
.valid(...Object.values(Loglevel))
|
||||
.default(Loglevel.WARN)
|
||||
|
|
Loading…
Reference in a new issue