updated address handling

This commit is contained in:
Andris Reinman 2018-01-24 16:31:37 +02:00
parent 261f28c15c
commit c35b719611
2 changed files with 21 additions and 18 deletions

View file

@ -297,8 +297,7 @@ module.exports = (db, server) => {
name: Joi.string() name: Joi.string()
.empty('') .empty('')
.trim() .trim()
.max(128) .max(128),
.required(),
main: Joi.boolean() main: Joi.boolean()
.truthy(['Y', 'true', 'yes', 'on', 1]) .truthy(['Y', 'true', 'yes', 'on', 1])
.falsy(['N', 'false', 'no', 'off', 0, '']), .falsy(['N', 'false', 'no', 'off', 0, '']),

View file

@ -549,14 +549,16 @@ module.exports = (db, server) => {
.lowercase() .lowercase()
.length(24) .length(24)
.empty(''), .empty(''),
targets: Joi.array().items( targets: Joi.array()
Joi.string().email(), .items(
Joi.string().uri({ Joi.string().email(),
scheme: [/smtps?/, /https?/], Joi.string().uri({
allowRelative: false, scheme: [/smtps?/, /https?/],
relativeOnly: false allowRelative: false,
}) relativeOnly: false
) })
)
.empty('')
}) })
.required() .required()
}); });
@ -869,14 +871,16 @@ module.exports = (db, server) => {
.lowercase() .lowercase()
.length(24) .length(24)
.empty(''), .empty(''),
targets: Joi.array().items( targets: Joi.array()
Joi.string().email(), .items(
Joi.string().uri({ Joi.string().email(),
scheme: [/smtps?/, /https?/], Joi.string().uri({
allowRelative: false, scheme: [/smtps?/, /https?/],
relativeOnly: false allowRelative: false,
}) relativeOnly: false
) })
)
.empty('')
}) })
}); });