Fix: starting with Peertube 3.2.0, there is a header X-Frame-Options. Removing it on the iframe route.

This commit is contained in:
John Livingston 2021-05-07 16:45:55 +02:00
parent 31c10621d1
commit 73ed34a2fa
2 changed files with 8 additions and 0 deletions

View File

@ -1,5 +1,11 @@
# Changelog
## ???
### Fixes
* Fix: starting with Peertube 3.2.0, there is a header 'X-Frame-Options'. Removing it on the iframe route.
## v2.1.3
* Fix: 2.1.0 was in fact correct... Did not work on my preprod env because of... a Livebox bug...

View File

@ -24,6 +24,8 @@ async function initWebchatRouter (options: RegisterServerOptions): Promise<Route
// eslint-disable-next-line @typescript-eslint/no-misused-promises
router.get('/room/:videoUUID', asyncMiddleware(
async (req: Request, res: Response, _next: NextFunction): Promise<void> => {
res.removeHeader('X-Frame-Options') // this route can be opened in an iframe
const settings = await settingsManager.getSettings([
'chat-use-prosody', 'chat-use-builtin', 'chat-room', 'chat-server',
'chat-bosh-uri', 'chat-ws-uri'