aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/controllers
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2022-01-06 13:27:29 +0100
committerChocobozzz <me@florianbigard.com>2022-01-06 13:27:29 +0100
commit795212f7acc690c88c86d0fab8772f6564d59cb8 (patch)
tree3a0203fc1957fd8cf8876774051137a0b04236fc /server/controllers
parent7b54a81cccf6b4c12269e9d6897d608b1a99537a (diff)
downloadPeerTube-795212f7acc690c88c86d0fab8772f6564d59cb8.tar.gz
PeerTube-795212f7acc690c88c86d0fab8772f6564d59cb8.tar.zst
PeerTube-795212f7acc690c88c86d0fab8772f6564d59cb8.zip
Prevent caption listing of private videos
Diffstat (limited to 'server/controllers')
-rw-r--r--server/controllers/api/videos/captions.ts2
-rw-r--r--server/controllers/api/videos/files.ts4
2 files changed, 4 insertions, 2 deletions
diff --git a/server/controllers/api/videos/captions.ts b/server/controllers/api/videos/captions.ts
index 2d2213327..aa7259ee9 100644
--- a/server/controllers/api/videos/captions.ts
+++ b/server/controllers/api/videos/captions.ts
@@ -48,7 +48,7 @@ export {
48// --------------------------------------------------------------------------- 48// ---------------------------------------------------------------------------
49 49
50async function listVideoCaptions (req: express.Request, res: express.Response) { 50async function listVideoCaptions (req: express.Request, res: express.Response) {
51 const data = await VideoCaptionModel.listVideoCaptions(res.locals.videoId.id) 51 const data = await VideoCaptionModel.listVideoCaptions(res.locals.onlyVideo.id)
52 52
53 return res.json(getFormattedObjects(data, data.length)) 53 return res.json(getFormattedObjects(data, data.length))
54} 54}
diff --git a/server/controllers/api/videos/files.ts b/server/controllers/api/videos/files.ts
index a8b32411d..0fbda280e 100644
--- a/server/controllers/api/videos/files.ts
+++ b/server/controllers/api/videos/files.ts
@@ -10,13 +10,15 @@ import {
10 ensureUserHasRight, 10 ensureUserHasRight,
11 videoFileMetadataGetValidator, 11 videoFileMetadataGetValidator,
12 videoFilesDeleteHLSValidator, 12 videoFilesDeleteHLSValidator,
13 videoFilesDeleteWebTorrentValidator 13 videoFilesDeleteWebTorrentValidator,
14 videosGetValidator
14} from '../../../middlewares' 15} from '../../../middlewares'
15 16
16const lTags = loggerTagsFactory('api', 'video') 17const lTags = loggerTagsFactory('api', 'video')
17const filesRouter = express.Router() 18const filesRouter = express.Router()
18 19
19filesRouter.get('/:id/metadata/:videoFileId', 20filesRouter.get('/:id/metadata/:videoFileId',
21 asyncMiddleware(videosGetValidator),
20 asyncMiddleware(videoFileMetadataGetValidator), 22 asyncMiddleware(videoFileMetadataGetValidator),
21 asyncMiddleware(getVideoFileMetadata) 23 asyncMiddleware(getVideoFileMetadata)
22) 24)