mirror of
https://github.com/overleaf/overleaf.git
synced 2025-01-30 10:32:42 +00:00
don't log missing files as warnings, but do report file access errors
This commit is contained in:
parent
80601eaa85
commit
308ca01b3c
1 changed files with 1 additions and 1 deletions
|
@ -29,10 +29,10 @@ module.exports = ForbidSymlinks = (staticFn, root, options) ->
|
|||
# check that the requested path is not a symlink
|
||||
fs.realpath requestedFsPath, (err, realFsPath)->
|
||||
if err?
|
||||
logger.warn err:err, requestedFsPath:requestedFsPath, realFsPath:realFsPath, path: req.params[0], project_id: req.params.project_id, "error checking file access"
|
||||
if err.code == 'ENOENT'
|
||||
return res.sendStatus(404)
|
||||
else
|
||||
logger.error err:err, requestedFsPath:requestedFsPath, realFsPath:realFsPath, path: req.params[0], project_id: req.params.project_id, "error checking file access"
|
||||
return res.sendStatus(500)
|
||||
else if requestedFsPath != realFsPath
|
||||
logger.warn requestedFsPath:requestedFsPath, realFsPath:realFsPath, path: req.params[0], project_id: req.params.project_id, "trying to access a different file (symlink), aborting"
|
||||
|
|
Loading…
Reference in a new issue