From fb4eade215ec838bb097c81066456bb13b19d1ed Mon Sep 17 00:00:00 2001 From: Johannes Zellner Date: Thu, 3 Oct 2019 16:23:01 +0200 Subject: [PATCH] Location in configure route may be an empty string --- src/routes/apps.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/routes/apps.js b/src/routes/apps.js index d7085760a..ce4407a9d 100644 --- a/src/routes/apps.js +++ b/src/routes/apps.js @@ -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'));