1
0
Fork 0

Also add "allow-forms" to oembed

This commit is contained in:
Chocobozzz 2024-03-19 15:29:32 +01:00
parent 78e4cc30c5
commit da63a030f3
No known key found for this signature in database
GPG key ID: 583A612D890159BE
2 changed files with 4 additions and 4 deletions

View file

@ -74,7 +74,7 @@ describe('Test services', function () {
const oembedUrl = server.url + basePath + video.uuid + suffix.input const oembedUrl = server.url + basePath + video.uuid + suffix.input
const res = await server.services.getOEmbed({ oembedUrl }) const res = await server.services.getOEmbed({ oembedUrl })
const expectedHtml = '<iframe width="560" height="315" sandbox="allow-same-origin allow-scripts allow-popups" ' + const expectedHtml = '<iframe width="560" height="315" sandbox="allow-same-origin allow-scripts allow-popups allow-forms" ' +
`title="${video.name}" src="http://${server.host}/videos/embed/${video.uuid}${suffix.output}" ` + `title="${video.name}" src="http://${server.host}/videos/embed/${video.uuid}${suffix.output}" ` +
'frameborder="0" allowfullscreen></iframe>' 'frameborder="0" allowfullscreen></iframe>'
@ -98,7 +98,7 @@ describe('Test services', function () {
const oembedUrl = server.url + basePath + playlistUUID + suffix.input const oembedUrl = server.url + basePath + playlistUUID + suffix.input
const res = await server.services.getOEmbed({ oembedUrl }) const res = await server.services.getOEmbed({ oembedUrl })
const expectedHtml = '<iframe width="560" height="315" sandbox="allow-same-origin allow-scripts allow-popups" ' + const expectedHtml = '<iframe width="560" height="315" sandbox="allow-same-origin allow-scripts allow-popups allow-forms" ' +
`title="${playlistDisplayName}" src="http://${server.host}/video-playlists/embed/${playlistUUID}${suffix.output}" ` + `title="${playlistDisplayName}" src="http://${server.host}/video-playlists/embed/${playlistUUID}${suffix.output}" ` +
'frameborder="0" allowfullscreen></iframe>' 'frameborder="0" allowfullscreen></iframe>'
@ -122,7 +122,7 @@ describe('Test services', function () {
const maxWidth = 50 const maxWidth = 50
const res = await server.services.getOEmbed({ oembedUrl, format, maxHeight, maxWidth }) const res = await server.services.getOEmbed({ oembedUrl, format, maxHeight, maxWidth })
const expectedHtml = '<iframe width="50" height="50" sandbox="allow-same-origin allow-scripts allow-popups" ' + const expectedHtml = '<iframe width="50" height="50" sandbox="allow-same-origin allow-scripts allow-popups allow-forms" ' +
`title="${video.name}" src="http://${server.host}/videos/embed/${video.uuid}" ` + `title="${video.name}" src="http://${server.host}/videos/embed/${video.uuid}" ` +
'frameborder="0" allowfullscreen></iframe>' 'frameborder="0" allowfullscreen></iframe>'

View file

@ -134,7 +134,7 @@ function buildOEmbed (options: {
thumbnailUrl = undefined thumbnailUrl = undefined
} }
const html = `<iframe width="${embedWidth}" height="${embedHeight}" sandbox="allow-same-origin allow-scripts allow-popups" ` + const html = `<iframe width="${embedWidth}" height="${embedHeight}" sandbox="allow-same-origin allow-scripts allow-popups allow-forms" ` +
`title="${embedTitle}" src="${embedUrl}" frameborder="0" allowfullscreen></iframe>` `title="${embedTitle}" src="${embedUrl}" frameborder="0" allowfullscreen></iframe>`
const json: any = { const json: any = {