aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/controllers/static.ts
diff options
context:
space:
mode:
Diffstat (limited to 'server/controllers/static.ts')
-rw-r--r--server/controllers/static.ts14
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'
27import { getThemeOrDefault } from '../lib/plugins/theme-utils' 27import { getThemeOrDefault } from '../lib/plugins/theme-utils'
28import { getEnabledResolutions, getRegisteredPlugins, getRegisteredThemes } from '@server/controllers/api/config' 28import { getEnabledResolutions, getRegisteredPlugins, getRegisteredThemes } from '@server/controllers/api/config'
29import { HttpStatusCode } from '@shared/core-utils/miscs/http-error-codes' 29import { HttpStatusCode } from '@shared/core-utils/miscs/http-error-codes'
30import { serveIndexHTML } from '@server/lib/client-html'
30 31
31const staticRouter = express.Router() 32const staticRouter = express.Router()
32 33
@@ -119,6 +120,11 @@ staticRouter.get('/robots.txt',
119 } 120 }
120) 121)
121 122
123staticRouter.all('/teapot',
124 getCup,
125 asyncMiddleware(serveIndexHTML)
126)
127
122// security.txt service 128// security.txt service
123staticRouter.get('/security.txt', 129staticRouter.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
401function 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}