Sanitize resource path along with rootResourcePath

This commit is contained in:
James Allen
2016-09-21 15:09:01 +01:00
parent 9f49dc8554
commit 79b3d2172b
2 changed files with 19 additions and 3 deletions

View File

@@ -42,7 +42,13 @@ module.exports = RequestParser =
compile.rootResourcePath
default: "main.tex"
type: "string"
response.rootResourcePath = RequestParser._sanitizePath(rootResourcePath)
originalRootResourcePath = rootResourcePath
sanitizedRootResourcePath = RequestParser._sanitizePath(rootResourcePath)
response.rootResourcePath = sanitizedRootResourcePath
for resource in response.resources
if resource.path == originalRootResourcePath
resource.path = sanitizedRootResourcePath
catch error
return callback error