mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-21 20:47:08 -05:00
use OutputCacheManager to construct static path to files
This commit is contained in:
parent
5fdd1d4f47
commit
a6fb82513f
1 changed files with 3 additions and 2 deletions
|
@ -12,6 +12,7 @@ Metrics.initialize("clsi")
|
|||
Metrics.open_sockets.monitor(logger)
|
||||
|
||||
ProjectPersistenceManager = require "./app/js/ProjectPersistenceManager"
|
||||
OutputCacheManager = require "./app/js/OutputCacheManager"
|
||||
|
||||
require("./app/js/db").sync()
|
||||
|
||||
|
@ -68,8 +69,8 @@ staticServer = staticForbidSymLinks Settings.path.compilesDir, setHeaders: (res,
|
|||
res.set("Content-Type", "text/plain")
|
||||
|
||||
app.get "/project/:project_id/output/*", require("./app/js/SymlinkCheckerMiddlewear"), (req, res, next) ->
|
||||
if req.query?.build? && req.query.build.match(/^[0-9]+$/)
|
||||
req.url = "/#{req.params.project_id}/.cache/clsi/#{req.query.build}/#{req.params[0]}"
|
||||
if req.query?.build? && req.query.build.match(OutputCacheManager.BUILD_REGEX)
|
||||
req.url = "/#{req.params.project_id}/" + OutputCacheManager.path(req.query.build) + "/#{req.params[0]}"
|
||||
else
|
||||
req.url = "/#{req.params.project_id}/#{req.params[0]}"
|
||||
staticServer(req, res, next)
|
||||
|
|
Loading…
Reference in a new issue