aboutsummaryrefslogtreecommitdiffhomepage
path: root/server
diff options
context:
space:
mode:
authorRigel Kent <sendmemail@rigelk.eu>2018-07-16 09:02:08 +0200
committerRigel Kent <par@rigelk.eu>2018-07-17 12:03:31 +0200
commitd00e2393d4269c0b4e280753e5f82ac06bd218c6 (patch)
tree93b25f059422413e8d81beddec4d256228f6c687 /server
parenta7dbc7dfc7a84b419a9b55d4a89e9a6e12384ae1 (diff)
downloadPeerTube-d00e2393d4269c0b4e280753e5f82ac06bd218c6.tar.gz
PeerTube-d00e2393d4269c0b4e280753e5f82ac06bd218c6.tar.zst
PeerTube-d00e2393d4269c0b4e280753e5f82ac06bd218c6.zip
selective route permission to use embeds with x-frame-deny
Diffstat (limited to 'server')
-rw-r--r--server/controllers/client.ts10
1 files changed, 7 insertions, 3 deletions
diff --git a/server/controllers/client.ts b/server/controllers/client.ts
index bfdf35021..13ca15e9d 100644
--- a/server/controllers/client.ts
+++ b/server/controllers/client.ts
@@ -1,5 +1,6 @@
1import * as Bluebird from 'bluebird' 1import * as Bluebird from 'bluebird'
2import * as express from 'express' 2import * as express from 'express'
3import * as helmet from 'helmet'
3import { join } from 'path' 4import { join } from 'path'
4import * as validator from 'validator' 5import * as validator from 'validator'
5import { escapeHTML, readFileBufferPromise, root } from '../helpers/core-utils' 6import { escapeHTML, readFileBufferPromise, root } from '../helpers/core-utils'
@@ -30,9 +31,12 @@ clientsRouter.use('/videos/watch/:id',
30) 31)
31 32
32clientsRouter.use('' + 33clientsRouter.use('' +
33 '/videos/embed', (req: express.Request, res: express.Response, next: express.NextFunction) => { 34 '/videos/embed',
34 res.sendFile(embedPath) 35 (req: express.Request, res: express.Response, next: express.NextFunction) => {
35}) 36 res.removeHeader('X-Frame-Options')
37 res.sendFile(embedPath)
38 }
39)
36clientsRouter.use('' + 40clientsRouter.use('' +
37 '/videos/test-embed', (req: express.Request, res: express.Response, next: express.NextFunction) => { 41 '/videos/test-embed', (req: express.Request, res: express.Response, next: express.NextFunction) => {
38 res.sendFile(testEmbedPath) 42 res.sendFile(testEmbedPath)