aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/controllers/client.ts
diff options
context:
space:
mode:
Diffstat (limited to 'server/controllers/client.ts')
-rw-r--r--server/controllers/client.ts18
1 files changed, 8 insertions, 10 deletions
diff --git a/server/controllers/client.ts b/server/controllers/client.ts
index e5bd487f1..f17f2a5d2 100644
--- a/server/controllers/client.ts
+++ b/server/controllers/client.ts
@@ -16,22 +16,20 @@ const testEmbedPath = join(distPath, 'standalone', 'videos', 'test-embed.html')
16 16
17// Special route that add OpenGraph and oEmbed tags 17// Special route that add OpenGraph and oEmbed tags
18// Do not use a template engine for a so little thing 18// Do not use a template engine for a so little thing
19clientsRouter.use('/videos/watch/:id', 19clientsRouter.use('/videos/watch/:id', asyncMiddleware(generateWatchHtmlPage))
20 asyncMiddleware(generateWatchHtmlPage)
21)
22 20
23clientsRouter.use('' + 21clientsRouter.use(
24 '/videos/embed', 22 '/videos/embed',
25 embedCSP, 23 embedCSP,
26 (req: express.Request, res: express.Response, next: express.NextFunction) => { 24 (req: express.Request, res: express.Response) => {
27 res.removeHeader('X-Frame-Options') 25 res.removeHeader('X-Frame-Options')
28 res.sendFile(embedPath) 26 res.sendFile(embedPath)
29 } 27 }
30) 28)
31clientsRouter.use('' + 29clientsRouter.use(
32 '/videos/test-embed', (req: express.Request, res: express.Response, next: express.NextFunction) => { 30 '/videos/test-embed',
33 res.sendFile(testEmbedPath) 31 (req: express.Request, res: express.Response) => res.sendFile(testEmbedPath)
34}) 32)
35 33
36// Static HTML/CSS/JS client files 34// Static HTML/CSS/JS client files
37 35
@@ -90,7 +88,7 @@ export {
90// --------------------------------------------------------------------------- 88// ---------------------------------------------------------------------------
91 89
92async function generateHTMLPage (req: express.Request, res: express.Response, paramLang?: string) { 90async function generateHTMLPage (req: express.Request, res: express.Response, paramLang?: string) {
93 const html = await ClientHtml.getIndexHTML(req, res, paramLang) 91 const html = await ClientHtml.getDefaultHTMLPage(req, res, paramLang)
94 92
95 return sendHTML(html, res) 93 return sendHTML(html, res)
96} 94}