aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/middlewares/validators/shared
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2022-10-19 10:43:53 +0200
committerChocobozzz <chocobozzz@cpy.re>2022-10-24 14:48:24 +0200
commit9ab330b90decf4edf152ff8e1d2948c065766b2c (patch)
tree29d924f50f7307e8e828a57ecb9ea78623487ce0 /server/middlewares/validators/shared
parent3545e72c686ff1725bbdfd8d16d693e2f4aa75a3 (diff)
downloadPeerTube-9ab330b90decf4edf152ff8e1d2948c065766b2c.tar.gz
PeerTube-9ab330b90decf4edf152ff8e1d2948c065766b2c.tar.zst
PeerTube-9ab330b90decf4edf152ff8e1d2948c065766b2c.zip
Use private ACL for private videos in s3
Diffstat (limited to 'server/middlewares/validators/shared')
-rw-r--r--server/middlewares/validators/shared/videos.ts6
1 files changed, 3 insertions, 3 deletions
diff --git a/server/middlewares/validators/shared/videos.ts b/server/middlewares/validators/shared/videos.ts
index c29751eca..ebbfc0a0a 100644
--- a/server/middlewares/validators/shared/videos.ts
+++ b/server/middlewares/validators/shared/videos.ts
@@ -111,7 +111,7 @@ async function checkCanSeeVideo (options: {
111}) { 111}) {
112 const { req, res, video, paramId } = options 112 const { req, res, video, paramId } = options
113 113
114 if (video.requiresAuth(paramId)) { 114 if (video.requiresAuth({ urlParamId: paramId, checkBlacklist: true })) {
115 return checkCanSeeAuthVideo(req, res, video) 115 return checkCanSeeAuthVideo(req, res, video)
116 } 116 }
117 117
@@ -174,13 +174,13 @@ async function checkCanAccessVideoStaticFiles (options: {
174 res: Response 174 res: Response
175 paramId: string 175 paramId: string
176}) { 176}) {
177 const { video, req, res, paramId } = options 177 const { video, req, res } = options
178 178
179 if (res.locals.oauth?.token.User) { 179 if (res.locals.oauth?.token.User) {
180 return checkCanSeeVideo(options) 180 return checkCanSeeVideo(options)
181 } 181 }
182 182
183 if (!video.requiresAuth(paramId)) return true 183 if (!video.hasPrivateStaticPath()) return true
184 184
185 const videoFileToken = req.query.videoFileToken 185 const videoFileToken = req.query.videoFileToken
186 if (!videoFileToken) { 186 if (!videoFileToken) {