Adds 403 response if PDF export is disabled

This commit is contained in:
geekyd 2017-10-25 19:21:34 +05:30
parent 0be09e109f
commit f7d2ef970a

View file

@ -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)