Location in configure route may be an empty string
This commit is contained in:
@@ -328,8 +328,7 @@ function setLocation(req, res, next) {
|
||||
assert.strictEqual(typeof req.body, 'object');
|
||||
assert.strictEqual(typeof req.params.id, 'string');
|
||||
|
||||
if (!req.body.location) return next(new HttpError(400, 'location is required'));
|
||||
if (typeof req.body.location !== 'string') return next(new HttpError(400, 'location must be string'));
|
||||
if (typeof req.body.location !== 'string') return next(new HttpError(400, 'location must be string')); // location may be an empty string
|
||||
if (!req.body.domain) return next(new HttpError(400, 'domain is required'));
|
||||
if (typeof req.body.domain !== 'string') return next(new HttpError(400, 'domain must be string'));
|
||||
|
||||
|
||||
Reference in New Issue
Block a user