Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
app.get('/logfiles/:filename', function(req, res, next) {
const sanitizedLogfile = path
.join(getFullLogDir(app), req.params.filename)
.replace(/\.\./g, '')
res.sendFile(sanitizedLogfile)
})
}