diff --git a/server.js b/server.js index d596cc769..b8b0a28f3 100644 --- a/server.js +++ b/server.js @@ -99,8 +99,8 @@ const shareFunction = function(req, res, type) { const setSourceHeaders = function (res, title, type) { res.status(200); - if (type == 'download') { - let fileName = sanitizeFilename(title).replaceAll(' ', '-'); + if(type == 'download') { + const fileName = sanitizeFilename(title).replaceAll(' ', '-'); res.set({ 'Cache-Control' : 'no-cache', @@ -108,18 +108,18 @@ const setSourceHeaders = function (res, title, type) { 'Content-Disposition' : `attachment; filename="HomeBrewery-${fileName}.txt"` }); } -} +}; const getSourceText = function (brewText, type) { if(type == 'source') { - return `
${brewText.replaceAll('&', '&').replaceAll('<','<').replaceAll('>', '>')}
`; + return `
${brewText.replaceAll('&', '&').replaceAll('<', '<').replaceAll('>', '>')}
`; } else if(type == 'download') { return brewText; } else { console.log('Unhandled source share type'); return; } -} +}; //Source page app.get('/source/:id', (req, res)=>{