aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/controllers/object-storage-proxy.ts
diff options
context:
space:
mode:
Diffstat (limited to 'server/controllers/object-storage-proxy.ts')
-rw-r--r--server/controllers/object-storage-proxy.ts15
1 files changed, 8 insertions, 7 deletions
diff --git a/server/controllers/object-storage-proxy.ts b/server/controllers/object-storage-proxy.ts
index 8e2cc4af9..d0c59bf93 100644
--- a/server/controllers/object-storage-proxy.ts
+++ b/server/controllers/object-storage-proxy.ts
@@ -1,11 +1,11 @@
1import cors from 'cors' 1import cors from 'cors'
2import express from 'express' 2import express from 'express'
3import { OBJECT_STORAGE_PROXY_PATHS } from '@server/initializers/constants' 3import { OBJECT_STORAGE_PROXY_PATHS } from '@server/initializers/constants'
4import { proxifyHLS, proxifyWebTorrentFile } from '@server/lib/object-storage' 4import { proxifyHLS, proxifyWebVideoFile } from '@server/lib/object-storage'
5import { 5import {
6 asyncMiddleware, 6 asyncMiddleware,
7 ensureCanAccessPrivateVideoHLSFiles, 7 ensureCanAccessPrivateVideoHLSFiles,
8 ensureCanAccessVideoPrivateWebTorrentFiles, 8 ensureCanAccessVideoPrivateWebVideoFiles,
9 ensurePrivateObjectStorageProxyIsEnabled, 9 ensurePrivateObjectStorageProxyIsEnabled,
10 optionalAuthenticate 10 optionalAuthenticate
11} from '@server/middlewares' 11} from '@server/middlewares'
@@ -15,11 +15,12 @@ const objectStorageProxyRouter = express.Router()
15 15
16objectStorageProxyRouter.use(cors()) 16objectStorageProxyRouter.use(cors())
17 17
18objectStorageProxyRouter.get(OBJECT_STORAGE_PROXY_PATHS.PRIVATE_WEBSEED + ':filename', 18objectStorageProxyRouter.get(
19 [ OBJECT_STORAGE_PROXY_PATHS.PRIVATE_WEB_VIDEOS + ':filename', OBJECT_STORAGE_PROXY_PATHS.LEGACY_PRIVATE_WEB_VIDEOS + ':filename' ],
19 ensurePrivateObjectStorageProxyIsEnabled, 20 ensurePrivateObjectStorageProxyIsEnabled,
20 optionalAuthenticate, 21 optionalAuthenticate,
21 asyncMiddleware(ensureCanAccessVideoPrivateWebTorrentFiles), 22 asyncMiddleware(ensureCanAccessVideoPrivateWebVideoFiles),
22 asyncMiddleware(proxifyWebTorrentController) 23 asyncMiddleware(proxifyWebVideoController)
23) 24)
24 25
25objectStorageProxyRouter.get(OBJECT_STORAGE_PROXY_PATHS.STREAMING_PLAYLISTS.PRIVATE_HLS + ':videoUUID/:filename', 26objectStorageProxyRouter.get(OBJECT_STORAGE_PROXY_PATHS.STREAMING_PLAYLISTS.PRIVATE_HLS + ':videoUUID/:filename',
@@ -35,10 +36,10 @@ export {
35 objectStorageProxyRouter 36 objectStorageProxyRouter
36} 37}
37 38
38function proxifyWebTorrentController (req: express.Request, res: express.Response) { 39function proxifyWebVideoController (req: express.Request, res: express.Response) {
39 const filename = req.params.filename 40 const filename = req.params.filename
40 41
41 return proxifyWebTorrentFile({ req, res, filename }) 42 return proxifyWebVideoFile({ req, res, filename })
42} 43}
43 44
44function proxifyHLSController (req: express.Request, res: express.Response) { 45function proxifyHLSController (req: express.Request, res: express.Response) {