mirror of
https://github.com/overleaf/overleaf.git
synced 2025-03-03 13:20:57 +00:00
parameter check on project_id
This commit is contained in:
parent
01d7a59dfd
commit
2f15adaf47
1 changed files with 6 additions and 0 deletions
|
@ -36,6 +36,12 @@ app.use (req, res, next) ->
|
||||||
res.setTimeout TIMEOUT
|
res.setTimeout TIMEOUT
|
||||||
next()
|
next()
|
||||||
|
|
||||||
|
app.param 'project_id', (req, res, next, project_id) ->
|
||||||
|
if project_id?.match /^[a-zA-Z0-9_-]+$/
|
||||||
|
next()
|
||||||
|
else
|
||||||
|
next new Error("invalid project id")
|
||||||
|
|
||||||
app.post "/project/:project_id/compile", bodyParser.json(limit: "5mb"), CompileController.compile
|
app.post "/project/:project_id/compile", bodyParser.json(limit: "5mb"), CompileController.compile
|
||||||
app.delete "/project/:project_id", CompileController.clearCache
|
app.delete "/project/:project_id", CompileController.clearCache
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue