@@ -249,8 +249,10 @@ function setAliases(req, res, next) {
|
||||
|
||||
if (!Array.isArray(req.body.aliases)) return next(new HttpError(400, 'aliases must be an array'));
|
||||
|
||||
for (var i = 0; i < req.body.aliases.length; i++) {
|
||||
if (typeof req.body.aliases[i] !== 'string') return next(new HttpError(400, 'alias must be a string'));
|
||||
for (let alias of req.body.aliases) {
|
||||
if (!alias || typeof alias !== 'object') return next(new HttpError(400, 'each alias must have a name and domain'));
|
||||
if (typeof alias.name !== 'string') return next(new HttpError(400, 'name must be a string'));
|
||||
if (typeof alias.domain !== 'string') return next(new HttpError(400, 'domain must be a string'));
|
||||
}
|
||||
|
||||
mail.setAliases(req.params.name, req.params.domain, req.body.aliases, function (error) {
|
||||
|
||||
Reference in New Issue
Block a user