From f7d2ef970a4b45dcc9d7bb0a4ff47d5915f4e4bc Mon Sep 17 00:00:00 2001 From: geekyd Date: Wed, 25 Oct 2017 19:21:34 +0530 Subject: [PATCH] Adds 403 response if PDF export is disabled --- lib/response.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lib/response.js b/lib/response.js index f0f7ce9b..9e39ffb5 100755 --- a/lib/response.js +++ b/lib/response.js @@ -384,7 +384,12 @@ function noteActions (req, res, next) { actionInfo(req, res, note) break case 'pdf': - actionPDF(req, res, note) + if (config.allowpdfexport) { + actionPDF(req, res, note) + } else { + logger.error('PDF export failed: Disabled by config. Set "allowpdfexport: true" to enable. Check the documentation for details') + response.errorForbidden(res) + } break case 'gist': actionGist(req, res, note)