fix path match

This commit is contained in:
Brian Gough
2017-03-21 11:30:32 +00:00
parent 021d848819
commit 750576d1b0
2 changed files with 9 additions and 1 deletions

View File

@@ -90,7 +90,7 @@ module.exports = ResourceWriter =
checkPath: (basePath, resourcePath, callback) ->
path = Path.normalize(Path.join(basePath, resourcePath))
if (path.slice(0, basePath.length) != basePath)
if (path.slice(0, basePath.length + 1) != basePath + "/")
return callback new Error("resource path is outside root directory")
else
return callback(null, path)