mirror of
https://github.com/overleaf/overleaf.git
synced 2024-10-31 21:21:03 -04:00
21 lines
731 B
CoffeeScript
21 lines
731 B
CoffeeScript
SecurityManager = require('../../managers/SecurityManager')
|
|
AuthenticationController = require('../Authentication/AuthenticationController')
|
|
ProjectUploadController = require "./ProjectUploadController"
|
|
RateLimiterMiddlewear = require('../Security/RateLimiterMiddlewear')
|
|
|
|
module.exports =
|
|
apply: (webRouter, apiRouter) ->
|
|
webRouter.post '/project/new/upload',
|
|
AuthenticationController.requireLogin(),
|
|
ProjectUploadController.uploadProject
|
|
|
|
webRouter.post '/Project/:Project_id/upload',
|
|
RateLimiterMiddlewear.rateLimit({
|
|
endpointName: "file-upload"
|
|
params: ["Project_id"]
|
|
maxRequests: 100
|
|
timeInterval: 60 * 20
|
|
}),
|
|
SecurityManager.requestCanModifyProject,
|
|
ProjectUploadController.uploadFile
|
|
|