diff options
Diffstat (limited to 'server/controllers/static.ts')
-rw-r--r-- | server/controllers/static.ts | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/server/controllers/static.ts b/server/controllers/static.ts index bbd0dd011..5ce739bfc 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,16 +21,16 @@ 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_WEBSEED, |
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 | ) |