Skip to content

Commit f7d2ef9

Browse files
committed
Adds 403 response if PDF export is disabled
1 parent 0be09e1 commit f7d2ef9

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

lib/response.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -384,7 +384,12 @@ function noteActions (req, res, next) {
384384
actionInfo(req, res, note)
385385
break
386386
case 'pdf':
387-
actionPDF(req, res, note)
387+
if (config.allowpdfexport) {
388+
actionPDF(req, res, note)
389+
} else {
390+
logger.error('PDF export failed: Disabled by config. Set "allowpdfexport: true" to enable. Check the documentation for details')
391+
response.errorForbidden(res)
392+
}
388393
break
389394
case 'gist':
390395
actionGist(req, res, note)

0 commit comments

Comments
 (0)