aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/middlewares/validators
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2021-10-14 11:35:43 +0200
committerChocobozzz <me@florianbigard.com>2021-10-14 11:35:43 +0200
commitcf0c8ee588e37809d85ec1deec1e4fdfa0f122a5 (patch)
tree1692868027592d2a300988643fdd96e5fdfe2091 /server/middlewares/validators
parente1a570abff3ebf375433e58e7362d56bd32d4cd8 (diff)
downloadPeerTube-cf0c8ee588e37809d85ec1deec1e4fdfa0f122a5.tar.gz
PeerTube-cf0c8ee588e37809d85ec1deec1e4fdfa0f122a5.tar.zst
PeerTube-cf0c8ee588e37809d85ec1deec1e4fdfa0f122a5.zip
Fix admin edition disabling feature
Diffstat (limited to 'server/middlewares/validators')
-rw-r--r--server/middlewares/validators/config.ts3
1 files changed, 2 insertions, 1 deletions
diff --git a/server/middlewares/validators/config.ts b/server/middlewares/validators/config.ts
index 5f1ac89bc..f0385ab44 100644
--- a/server/middlewares/validators/config.ts
+++ b/server/middlewares/validators/config.ts
@@ -106,12 +106,13 @@ const customConfigUpdateValidator = [
106] 106]
107 107
108function ensureConfigIsEditable (req: express.Request, res: express.Response, next: express.NextFunction) { 108function ensureConfigIsEditable (req: express.Request, res: express.Response, next: express.NextFunction) {
109 if (!CONFIG.WEBADMIN.CONFIGURATION.EDITS.ALLOWED) { 109 if (!CONFIG.WEBADMIN.CONFIGURATION.EDITION.ALLOWED) {
110 return res.fail({ 110 return res.fail({
111 status: HttpStatusCode.METHOD_NOT_ALLOWED_405, 111 status: HttpStatusCode.METHOD_NOT_ALLOWED_405,
112 message: 'Server configuration is static and cannot be edited' 112 message: 'Server configuration is static and cannot be edited'
113 }) 113 })
114 } 114 }
115
115 return next() 116 return next()
116} 117}
117 118