summaryrefslogtreecommitdiff
path: root/lib/response.js
diff options
context:
space:
mode:
authorgeekyd2017-10-25 19:21:34 +0530
committergeekyd2017-10-25 19:21:34 +0530
commitf7d2ef970a4b45dcc9d7bb0a4ff47d5915f4e4bc (patch)
tree0b808b294a37806e10b1277477cf5cf79afa6b02 /lib/response.js
parent0be09e109fb2f5c76b488066834a92ce5c29c5cc (diff)
Adds 403 response if PDF export is disabled
Diffstat (limited to 'lib/response.js')
-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)