summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorgeekyd2017-10-25 19:21:34 +0530
committergeekyd2017-10-25 19:21:34 +0530
commitf7d2ef970a4b45dcc9d7bb0a4ff47d5915f4e4bc (patch)
tree0b808b294a37806e10b1277477cf5cf79afa6b02
parent0be09e109fb2f5c76b488066834a92ce5c29c5cc (diff)
Adds 403 response if PDF export is disabled
-rwxr-xr-xlib/response.js7
1 files changed, 6 insertions, 1 deletions
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)