mirror of
https://github.com/Chocobozzz/PeerTube.git
synced 2025-10-05 02:39:33 +02:00
selective route permission to use embeds with x-frame-deny
This commit is contained in:
parent
a7dbc7dfc7
commit
d00e2393d4
4 changed files with 184 additions and 3 deletions
|
@ -1,5 +1,6 @@
|
|||
import * as Bluebird from 'bluebird'
|
||||
import * as express from 'express'
|
||||
import * as helmet from 'helmet'
|
||||
import { join } from 'path'
|
||||
import * as validator from 'validator'
|
||||
import { escapeHTML, readFileBufferPromise, root } from '../helpers/core-utils'
|
||||
|
@ -30,9 +31,12 @@ clientsRouter.use('/videos/watch/:id',
|
|||
)
|
||||
|
||||
clientsRouter.use('' +
|
||||
'/videos/embed', (req: express.Request, res: express.Response, next: express.NextFunction) => {
|
||||
res.sendFile(embedPath)
|
||||
})
|
||||
'/videos/embed',
|
||||
(req: express.Request, res: express.Response, next: express.NextFunction) => {
|
||||
res.removeHeader('X-Frame-Options')
|
||||
res.sendFile(embedPath)
|
||||
}
|
||||
)
|
||||
clientsRouter.use('' +
|
||||
'/videos/test-embed', (req: express.Request, res: express.Response, next: express.NextFunction) => {
|
||||
res.sendFile(testEmbedPath)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue