mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-21 20:47:08 -05:00
Merge pull request #5838 from overleaf/jpa-fix-load-editor-metrics
[web] fix the http-request metric options for loading the editor GitOrigin-RevId: 8c87ebd5be77a918b719ddd061b4758efb277a90
This commit is contained in:
parent
2261e761f4
commit
44b3fece89
1 changed files with 19 additions and 12 deletions
|
@ -294,18 +294,25 @@ function initialize(webRouter, privateApiRouter, publicApiRouter) {
|
||||||
ProjectController.newProject
|
ProjectController.newProject
|
||||||
)
|
)
|
||||||
|
|
||||||
webRouter.get(
|
for (const route of [
|
||||||
'/Project/:Project_id/:detachRole(detacher|detached)?',
|
// Keep the old route for continuous metrics
|
||||||
RateLimiterMiddleware.rateLimit({
|
'/Project/:Project_id',
|
||||||
endpointName: 'open-project',
|
// New route for pdf-detach
|
||||||
params: ['Project_id'],
|
'/Project/:Project_id/:detachRole(detacher|detached)',
|
||||||
maxRequests: 15,
|
]) {
|
||||||
timeInterval: 60,
|
webRouter.get(
|
||||||
}),
|
route,
|
||||||
AuthenticationController.validateUserSession(),
|
RateLimiterMiddleware.rateLimit({
|
||||||
AuthorizationMiddleware.ensureUserCanReadProject,
|
endpointName: 'open-project',
|
||||||
ProjectController.loadEditor
|
params: ['Project_id'],
|
||||||
)
|
maxRequests: 15,
|
||||||
|
timeInterval: 60,
|
||||||
|
}),
|
||||||
|
AuthenticationController.validateUserSession(),
|
||||||
|
AuthorizationMiddleware.ensureUserCanReadProject,
|
||||||
|
ProjectController.loadEditor
|
||||||
|
)
|
||||||
|
}
|
||||||
webRouter.head(
|
webRouter.head(
|
||||||
'/Project/:Project_id/file/:File_id',
|
'/Project/:Project_id/file/:File_id',
|
||||||
AuthorizationMiddleware.ensureUserCanReadProject,
|
AuthorizationMiddleware.ensureUserCanReadProject,
|
||||||
|
|
Loading…
Reference in a new issue