mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-07 20:31:06 -05:00
Ensure that a "create linked file" request includes a name (#16673)
GitOrigin-RevId: 6b4ffac59f299e297f0a9a14a72ad7cea2508c3c
This commit is contained in:
parent
14e14be8ef
commit
2566dff9d8
1 changed files with 7 additions and 0 deletions
|
@ -3,6 +3,7 @@ const AuthenticationController = require('../Authentication/AuthenticationContro
|
|||
const { RateLimiter } = require('../../infrastructure/RateLimiter')
|
||||
const RateLimiterMiddleware = require('../Security/RateLimiterMiddleware')
|
||||
const LinkedFilesController = require('./LinkedFilesController')
|
||||
const { validate, Joi } = require('../../infrastructure/Validation')
|
||||
|
||||
const rateLimiters = {
|
||||
createLinkedFile: new RateLimiter('create-linked-file', {
|
||||
|
@ -24,6 +25,12 @@ module.exports = {
|
|||
RateLimiterMiddleware.rateLimit(rateLimiters.createLinkedFile, {
|
||||
params: ['project_id'],
|
||||
}),
|
||||
validate({
|
||||
body: {
|
||||
name: Joi.string().required(),
|
||||
// TODO: validate the remaining properties
|
||||
},
|
||||
}),
|
||||
LinkedFilesController.createLinkedFile
|
||||
)
|
||||
|
||||
|
|
Loading…
Reference in a new issue