mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-06-06 15:49:01 +02:00
Merge pull request #22481 from overleaf/bg-fix-blob-redirect-middleware
fix fileToBlobRedirectMiddleware internal redirect GitOrigin-RevId: 874196d58f8b657d73a8e7f1ea4fef8290d48a10
This commit is contained in:
@@ -85,14 +85,16 @@ module.exports = HistoryController = {
|
||||
if (err) {
|
||||
return next(err)
|
||||
}
|
||||
if (file?.hash) {
|
||||
req.url = `/project/${projectId}/blob/${file.hash}`
|
||||
}
|
||||
metrics.inc('fileToBlobRedirectMiddleware', 1, {
|
||||
method: req.method,
|
||||
status: Boolean(file?.hash),
|
||||
})
|
||||
next()
|
||||
if (file?.hash) {
|
||||
req.url = `/project/${projectId}/blob/${file.hash}`
|
||||
next('route') // redirect to blob route
|
||||
} else {
|
||||
next() // continue with file route
|
||||
}
|
||||
}
|
||||
)
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user