diff options
Diffstat (limited to 'server/controllers')
-rw-r--r-- | server/controllers/client.ts | 18 |
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 |
19 | clientsRouter.use('/videos/watch/:id', | 19 | clientsRouter.use('/videos/watch/:id', asyncMiddleware(generateWatchHtmlPage)) |
20 | asyncMiddleware(generateWatchHtmlPage) | ||
21 | ) | ||
22 | 20 | ||
23 | clientsRouter.use('' + | 21 | clientsRouter.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 | ) |
31 | clientsRouter.use('' + | 29 | clientsRouter.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 | ||
92 | async function generateHTMLPage (req: express.Request, res: express.Response, paramLang?: string) { | 90 | async 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 | } |