aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/controllers/static.ts
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2023-07-11 09:21:13 +0200
committerChocobozzz <me@florianbigard.com>2023-07-11 09:21:13 +0200
commit784e2ad5c34bcfef36a3f69e9e9acd7cbb3d6428 (patch)
tree29c46cfd6344065eb805680ed080cb05592ee1d4 /server/controllers/static.ts
parentc3030e944ad03c7fd7b5d668a2d88ff03e4cdf19 (diff)
downloadPeerTube-784e2ad5c34bcfef36a3f69e9e9acd7cbb3d6428.tar.gz
PeerTube-784e2ad5c34bcfef36a3f69e9e9acd7cbb3d6428.tar.zst
PeerTube-784e2ad5c34bcfef36a3f69e9e9acd7cbb3d6428.zip
Prefer web videos in favour of webtorrent
Diffstat (limited to 'server/controllers/static.ts')
-rw-r--r--server/controllers/static.ts10
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'
6import { 6import {
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()
21staticRouter.use(cors()) 21staticRouter.use(cors())
22 22
23// --------------------------------------------------------------------------- 23// ---------------------------------------------------------------------------
24// WebTorrent/Classic videos 24// Web videos/Classic videos
25// --------------------------------------------------------------------------- 25// ---------------------------------------------------------------------------
26 26
27const privateWebTorrentStaticMiddlewares = CONFIG.STATIC_FILES.PRIVATE_FILES_REQUIRE_AUTH === true 27const privateWebVideoStaticMiddlewares = CONFIG.STATIC_FILES.PRIVATE_FILES_REQUIRE_AUTH === true
28 ? [ optionalAuthenticate, asyncMiddleware(ensureCanAccessVideoPrivateWebTorrentFiles) ] 28 ? [ optionalAuthenticate, asyncMiddleware(ensureCanAccessVideoPrivateWebVideoFiles) ]
29 : [] 29 : []
30 30
31staticRouter.use( 31staticRouter.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)