mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-21 20:47:08 -05:00
Merge pull request #7194 from overleaf/jpa-rate-limit-zip-download
[web] rate-limit project zip download requests GitOrigin-RevId: c99b7474de26b0e8a288863dccb60a25adfdc1b0
This commit is contained in:
parent
c192002f53
commit
f4d17f78f7
1 changed files with 11 additions and 0 deletions
|
@ -670,11 +670,22 @@ function initialize(webRouter, privateApiRouter, publicApiRouter) {
|
||||||
|
|
||||||
webRouter.get(
|
webRouter.get(
|
||||||
'/Project/:Project_id/download/zip',
|
'/Project/:Project_id/download/zip',
|
||||||
|
RateLimiterMiddleware.rateLimit({
|
||||||
|
endpointName: 'zip-download',
|
||||||
|
params: ['Project_id'],
|
||||||
|
maxRequests: 10,
|
||||||
|
timeInterval: 60,
|
||||||
|
}),
|
||||||
AuthorizationMiddleware.ensureUserCanReadProject,
|
AuthorizationMiddleware.ensureUserCanReadProject,
|
||||||
ProjectDownloadsController.downloadProject
|
ProjectDownloadsController.downloadProject
|
||||||
)
|
)
|
||||||
webRouter.get(
|
webRouter.get(
|
||||||
'/project/download/zip',
|
'/project/download/zip',
|
||||||
|
RateLimiterMiddleware.rateLimit({
|
||||||
|
endpointName: 'multiple-projects-zip-download',
|
||||||
|
maxRequests: 10,
|
||||||
|
timeInterval: 60,
|
||||||
|
}),
|
||||||
AuthorizationMiddleware.ensureUserCanReadMultipleProjects,
|
AuthorizationMiddleware.ensureUserCanReadMultipleProjects,
|
||||||
ProjectDownloadsController.downloadMultipleProjects
|
ProjectDownloadsController.downloadMultipleProjects
|
||||||
)
|
)
|
||||||
|
|
Loading…
Reference in a new issue