From 22dc14037e8375fed2e323950786a9954c5497f0 Mon Sep 17 00:00:00 2001 From: Diego Sampaio Date: Fri, 26 Nov 2021 19:11:04 -0300 Subject: [PATCH] Fix headers already sent error when user data download is disabled --- app/user-data-download/server/exportDownload.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/user-data-download/server/exportDownload.js b/app/user-data-download/server/exportDownload.js index 6ea406de307c..0bee6de16377 100644 --- a/app/user-data-download/server/exportDownload.js +++ b/app/user-data-download/server/exportDownload.js @@ -10,8 +10,8 @@ WebApp.connectHandlers.use(DataExport.getPath(), async function(req, res, next) const match = /^\/([^\/]+)/.exec(req.url); if (!settings.get('UserData_EnableDownload')) { - res.writeHead(403); res.setHeader('Content-Type', 'text/html; charset=UTF-8'); + res.writeHead(403); return res.end(DataExport.getErrorPage(TAPi18n.__('Feature_Disabled'), TAPi18n.__('UserDataDownload_FeatureDisabled'))); }