diff options
Diffstat (limited to 'server/controllers/static.ts')
-rw-r--r-- | server/controllers/static.ts | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/server/controllers/static.ts b/server/controllers/static.ts index 9baff94c0..97caa8292 100644 --- a/server/controllers/static.ts +++ b/server/controllers/static.ts | |||
@@ -6,7 +6,7 @@ import { injectQueryToPlaylistUrls } from '@server/lib/hls' | |||
6 | import { | 6 | import { |
7 | asyncMiddleware, | 7 | asyncMiddleware, |
8 | ensureCanAccessPrivateVideoHLSFiles, | 8 | ensureCanAccessPrivateVideoHLSFiles, |
9 | ensureCanAccessVideoPrivateWebTorrentFiles, | 9 | ensureCanAccessVideoPrivateWebVideoFiles, |
10 | handleStaticError, | 10 | handleStaticError, |
11 | optionalAuthenticate | 11 | optionalAuthenticate |
12 | } from '@server/middlewares' | 12 | } from '@server/middlewares' |
@@ -21,21 +21,21 @@ const staticRouter = express.Router() | |||
21 | staticRouter.use(cors()) | 21 | staticRouter.use(cors()) |
22 | 22 | ||
23 | // --------------------------------------------------------------------------- | 23 | // --------------------------------------------------------------------------- |
24 | // WebTorrent/Classic videos | 24 | // Web videos/Classic videos |
25 | // --------------------------------------------------------------------------- | 25 | // --------------------------------------------------------------------------- |
26 | 26 | ||
27 | const privateWebTorrentStaticMiddlewares = CONFIG.STATIC_FILES.PRIVATE_FILES_REQUIRE_AUTH === true | 27 | const privateWebVideoStaticMiddlewares = CONFIG.STATIC_FILES.PRIVATE_FILES_REQUIRE_AUTH === true |
28 | ? [ optionalAuthenticate, asyncMiddleware(ensureCanAccessVideoPrivateWebTorrentFiles) ] | 28 | ? [ optionalAuthenticate, asyncMiddleware(ensureCanAccessVideoPrivateWebVideoFiles) ] |
29 | : [] | 29 | : [] |
30 | 30 | ||
31 | staticRouter.use( | 31 | staticRouter.use( |
32 | STATIC_PATHS.PRIVATE_WEBSEED, | 32 | [ STATIC_PATHS.PRIVATE_WEB_VIDEOS, STATIC_PATHS.LEGACY_PRIVATE_WEB_VIDEOS ], |
33 | ...privateWebTorrentStaticMiddlewares, | 33 | ...privateWebVideoStaticMiddlewares, |
34 | express.static(DIRECTORIES.VIDEOS.PRIVATE, { fallthrough: false }), | 34 | express.static(DIRECTORIES.VIDEOS.PRIVATE, { fallthrough: false }), |
35 | handleStaticError | 35 | handleStaticError |
36 | ) | 36 | ) |
37 | staticRouter.use( | 37 | staticRouter.use( |
38 | STATIC_PATHS.WEBSEED, | 38 | [ STATIC_PATHS.WEB_VIDEOS, STATIC_PATHS.LEGACY_WEB_VIDEOS ], |
39 | express.static(DIRECTORIES.VIDEOS.PUBLIC, { fallthrough: false }), | 39 | express.static(DIRECTORIES.VIDEOS.PUBLIC, { fallthrough: false }), |
40 | handleStaticError | 40 | handleStaticError |
41 | ) | 41 | ) |
@@ -72,7 +72,7 @@ staticRouter.use( | |||
72 | handleStaticError | 72 | handleStaticError |
73 | ) | 73 | ) |
74 | 74 | ||
75 | // Thumbnails path for express | 75 | // FIXME: deprecated in v6, to remove |
76 | const thumbnailsPhysicalPath = CONFIG.STORAGE.THUMBNAILS_DIR | 76 | const thumbnailsPhysicalPath = CONFIG.STORAGE.THUMBNAILS_DIR |
77 | staticRouter.use( | 77 | staticRouter.use( |
78 | STATIC_PATHS.THUMBNAILS, | 78 | STATIC_PATHS.THUMBNAILS, |