From 784e2ad5c34bcfef36a3f69e9e9acd7cbb3d6428 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Tue, 11 Jul 2023 09:21:13 +0200 Subject: Prefer web videos in favour of webtorrent --- server/middlewares/validators/static.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'server/middlewares/validators/static.ts') diff --git a/server/middlewares/validators/static.ts b/server/middlewares/validators/static.ts index 36a94080c..86cc0a8d7 100644 --- a/server/middlewares/validators/static.ts +++ b/server/middlewares/validators/static.ts @@ -22,7 +22,7 @@ const staticFileTokenBypass = new LRUCache({ ttl: LRU_CACHE.STATIC_VIDEO_FILES_RIGHTS_CHECK.TTL }) -const ensureCanAccessVideoPrivateWebTorrentFiles = [ +const ensureCanAccessVideoPrivateWebVideoFiles = [ query('videoFileToken').optional().custom(exists), isValidVideoPasswordHeader(), @@ -48,7 +48,7 @@ const ensureCanAccessVideoPrivateWebTorrentFiles = [ return res.sendStatus(HttpStatusCode.FORBIDDEN_403) } - const result = await isWebTorrentAllowed(req, res) + const result = await isWebVideoAllowed(req, res) staticFileTokenBypass.set(cacheKey, result) @@ -122,13 +122,13 @@ const ensureCanAccessPrivateVideoHLSFiles = [ ] export { - ensureCanAccessVideoPrivateWebTorrentFiles, + ensureCanAccessVideoPrivateWebVideoFiles, ensureCanAccessPrivateVideoHLSFiles } // --------------------------------------------------------------------------- -async function isWebTorrentAllowed (req: express.Request, res: express.Response) { +async function isWebVideoAllowed (req: express.Request, res: express.Response) { const filename = basename(req.path) const file = await VideoFileModel.loadWithVideoByFilename(filename) -- cgit v1.2.3