diff options
Diffstat (limited to 'server/controllers/static.ts')
-rw-r--r-- | server/controllers/static.ts | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/server/controllers/static.ts b/server/controllers/static.ts index ff77452dd..f12f00e1b 100644 --- a/server/controllers/static.ts +++ b/server/controllers/static.ts | |||
@@ -27,6 +27,7 @@ import { getTorrentFilePath, getVideoFilePath } from '@server/lib/video-paths' | |||
27 | import { getThemeOrDefault } from '../lib/plugins/theme-utils' | 27 | import { getThemeOrDefault } from '../lib/plugins/theme-utils' |
28 | import { getEnabledResolutions, getRegisteredPlugins, getRegisteredThemes } from '@server/controllers/api/config' | 28 | import { getEnabledResolutions, getRegisteredPlugins, getRegisteredThemes } from '@server/controllers/api/config' |
29 | import { HttpStatusCode } from '@shared/core-utils/miscs/http-error-codes' | 29 | import { HttpStatusCode } from '@shared/core-utils/miscs/http-error-codes' |
30 | import { serveIndexHTML } from '@server/lib/client-html' | ||
30 | 31 | ||
31 | const staticRouter = express.Router() | 32 | const staticRouter = express.Router() |
32 | 33 | ||
@@ -119,6 +120,11 @@ staticRouter.get('/robots.txt', | |||
119 | } | 120 | } |
120 | ) | 121 | ) |
121 | 122 | ||
123 | staticRouter.all('/teapot', | ||
124 | getCup, | ||
125 | asyncMiddleware(serveIndexHTML) | ||
126 | ) | ||
127 | |||
122 | // security.txt service | 128 | // security.txt service |
123 | staticRouter.get('/security.txt', | 129 | staticRouter.get('/security.txt', |
124 | (_, res: express.Response) => { | 130 | (_, res: express.Response) => { |
@@ -391,3 +397,11 @@ function getHLSPlaylist (video: MVideoFullLight) { | |||
391 | 397 | ||
392 | return Object.assign(playlist, { Video: video }) | 398 | return Object.assign(playlist, { Video: video }) |
393 | } | 399 | } |
400 | |||
401 | function getCup (req: express.Request, res: express.Response, next: express.NextFunction) { | ||
402 | res.status(HttpStatusCode.I_AM_A_TEAPOT_418) | ||
403 | res.setHeader('Accept-Additions', 'Non-Dairy;1,Sugar;1') | ||
404 | res.setHeader('Safe', 'if-sepia-awake') | ||
405 | |||
406 | return next() | ||
407 | } | ||