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
1 changed files with 6 additions and 1 deletions

View File

@ -384,7 +384,12 @@ function noteActions (req, res, next) {
actionInfo(req, res, note)
break
case 'pdf':
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)