use 405 when feature disabled

403 will logout the user
This commit is contained in:
Girish Ramakrishnan
2019-05-10 09:50:31 -07:00
parent ecc9415679
commit 7177f82041
2 changed files with 3 additions and 3 deletions
+2 -2
View File
@@ -143,7 +143,7 @@ function getBackupConfig(req, res, next) {
function setBackupConfig(req, res, next) {
assert.strictEqual(typeof req.body, 'object');
if (!custom.features().configureBackup) return next(new HttpError(403, 'feature disabled by admin'));
if (!custom.features().configureBackup) return next(new HttpError(405, 'feature disabled by admin'));
if (typeof req.body.provider !== 'string') return next(new HttpError(400, 'provider is required'));
if (typeof req.body.retentionSecs !== 'number') return next(new HttpError(400, 'retentionSecs is required'));
@@ -207,7 +207,7 @@ function getDynamicDnsConfig(req, res, next) {
function setDynamicDnsConfig(req, res, next) {
assert.strictEqual(typeof req.body, 'object');
if (!custom.features().dynamicDns) return next(new HttpError(403, 'feature disabled by admin'));
if (!custom.features().dynamicDns) return next(new HttpError(405, 'feature disabled by admin'));
if (typeof req.body.enabled !== 'boolean') return next(new HttpError(400, 'enabled boolean is required'));