use explicit json content-type to avoid security issues with text/html
This commit is contained in:
@@ -84,7 +84,7 @@ module.exports = CompileController =
|
||||
user_id = req.params.user_id
|
||||
CompileManager.syncFromCode project_id, user_id, file, line, column, (error, pdfPositions) ->
|
||||
return next(error) if error?
|
||||
res.send JSON.stringify {
|
||||
res.json {
|
||||
pdf: pdfPositions
|
||||
}
|
||||
|
||||
@@ -96,7 +96,7 @@ module.exports = CompileController =
|
||||
user_id = req.params.user_id
|
||||
CompileManager.syncFromPdf project_id, user_id, page, h, v, (error, codePositions) ->
|
||||
return next(error) if error?
|
||||
res.send JSON.stringify {
|
||||
res.json {
|
||||
code: codePositions
|
||||
}
|
||||
|
||||
@@ -109,7 +109,7 @@ module.exports = CompileController =
|
||||
|
||||
CompileManager.wordcount project_id, user_id, file, image, (error, result) ->
|
||||
return next(error) if error?
|
||||
res.send JSON.stringify {
|
||||
res.json {
|
||||
texcount: result
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user