Просмотр исходного кода

don't log missing files as warnings, but do report file access errors

Brian Gough 10 лет назад
Родитель
Сommit
308ca01b3c
1 измененных файлов с 1 добавлено и 1 удалено
  1. 1 1
      services/clsi/app/coffee/StaticServerForbidSymlinks.coffee

+ 1 - 1
services/clsi/app/coffee/StaticServerForbidSymlinks.coffee

@@ -29,10 +29,10 @@ module.exports = ForbidSymlinks = (staticFn, root, options) ->
 		# check that the requested path is not a symlink
 		# check that the requested path is not a symlink
 		fs.realpath requestedFsPath, (err, realFsPath)->
 		fs.realpath requestedFsPath, (err, realFsPath)->
 			if err?
 			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'
 				if err.code == 'ENOENT'
 					return res.sendStatus(404)
 					return res.sendStatus(404)
 				else
 				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)
 					return res.sendStatus(500)
 			else if requestedFsPath != realFsPath
 			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"
 				logger.warn requestedFsPath:requestedFsPath, realFsPath:realFsPath, path: req.params[0], project_id: req.params.project_id, "trying to access a different file (symlink), aborting"