diff options
Diffstat (limited to 'server/controllers/lazy-static.ts')
-rw-r--r-- | server/controllers/lazy-static.ts | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/server/controllers/lazy-static.ts b/server/controllers/lazy-static.ts index 0cab5dcd0..b082e41f6 100644 --- a/server/controllers/lazy-static.ts +++ b/server/controllers/lazy-static.ts | |||
@@ -7,7 +7,7 @@ import { logger } from '../helpers/logger' | |||
7 | import { ACTOR_IMAGES_SIZE, LAZY_STATIC_PATHS, STATIC_MAX_AGE } from '../initializers/constants' | 7 | import { ACTOR_IMAGES_SIZE, LAZY_STATIC_PATHS, STATIC_MAX_AGE } from '../initializers/constants' |
8 | import { VideosCaptionCache, VideosPreviewCache } from '../lib/files-cache' | 8 | import { VideosCaptionCache, VideosPreviewCache } from '../lib/files-cache' |
9 | import { actorImagePathUnsafeCache, downloadActorImageFromWorker } from '../lib/local-actor' | 9 | import { actorImagePathUnsafeCache, downloadActorImageFromWorker } from '../lib/local-actor' |
10 | import { asyncMiddleware } from '../middlewares' | 10 | import { asyncMiddleware, handleStaticError } from '../middlewares' |
11 | import { ActorImageModel } from '../models/actor/actor-image' | 11 | import { ActorImageModel } from '../models/actor/actor-image' |
12 | 12 | ||
13 | const lazyStaticRouter = express.Router() | 13 | const lazyStaticRouter = express.Router() |
@@ -16,27 +16,32 @@ lazyStaticRouter.use(cors()) | |||
16 | 16 | ||
17 | lazyStaticRouter.use( | 17 | lazyStaticRouter.use( |
18 | LAZY_STATIC_PATHS.AVATARS + ':filename', | 18 | LAZY_STATIC_PATHS.AVATARS + ':filename', |
19 | asyncMiddleware(getActorImage) | 19 | asyncMiddleware(getActorImage), |
20 | handleStaticError | ||
20 | ) | 21 | ) |
21 | 22 | ||
22 | lazyStaticRouter.use( | 23 | lazyStaticRouter.use( |
23 | LAZY_STATIC_PATHS.BANNERS + ':filename', | 24 | LAZY_STATIC_PATHS.BANNERS + ':filename', |
24 | asyncMiddleware(getActorImage) | 25 | asyncMiddleware(getActorImage), |
26 | handleStaticError | ||
25 | ) | 27 | ) |
26 | 28 | ||
27 | lazyStaticRouter.use( | 29 | lazyStaticRouter.use( |
28 | LAZY_STATIC_PATHS.PREVIEWS + ':filename', | 30 | LAZY_STATIC_PATHS.PREVIEWS + ':filename', |
29 | asyncMiddleware(getPreview) | 31 | asyncMiddleware(getPreview), |
32 | handleStaticError | ||
30 | ) | 33 | ) |
31 | 34 | ||
32 | lazyStaticRouter.use( | 35 | lazyStaticRouter.use( |
33 | LAZY_STATIC_PATHS.VIDEO_CAPTIONS + ':filename', | 36 | LAZY_STATIC_PATHS.VIDEO_CAPTIONS + ':filename', |
34 | asyncMiddleware(getVideoCaption) | 37 | asyncMiddleware(getVideoCaption), |
38 | handleStaticError | ||
35 | ) | 39 | ) |
36 | 40 | ||
37 | lazyStaticRouter.use( | 41 | lazyStaticRouter.use( |
38 | LAZY_STATIC_PATHS.TORRENTS + ':filename', | 42 | LAZY_STATIC_PATHS.TORRENTS + ':filename', |
39 | asyncMiddleware(getTorrent) | 43 | asyncMiddleware(getTorrent), |
44 | handleStaticError | ||
40 | ) | 45 | ) |
41 | 46 | ||
42 | // --------------------------------------------------------------------------- | 47 | // --------------------------------------------------------------------------- |