summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorSamantaz Fox <coding@samantaz.fr>2024-07-10 22:24:18 +0200
committerSamantaz Fox <coding@samantaz.fr>2024-07-10 22:24:18 +0200
commit5e0f55333afd03190d84da8fd21b084775cdf916 (patch)
tree5432a628c578feb729ddb9ac04cac7ca617bde4a /src
parentde61b163a3d55aee1309ce5a89bfe864d2e08e75 (diff)
parent4adb4c00d2099ad7892579bfe4777d6f64a807a0 (diff)
downloadinvidious-5e0f55333afd03190d84da8fd21b084775cdf916.tar.gz
invidious-5e0f55333afd03190d84da8fd21b084775cdf916.tar.bz2
invidious-5e0f55333afd03190d84da8fd21b084775cdf916.zip
Allow embedding videos in local HTML files (#4450)
The current Content Security Policy does not allow to embed videos inside local HTML files which are viewed in the browser via the file protocol. This commit adds the file protocol to the allowed frame ancestors, so that the embedded videos load correctly in local HTML files. This behaviour is consistent which how the official YouTube website allows to embed videos from itself. Closes issue 4448
Diffstat (limited to 'src')
-rw-r--r--src/invidious/routes/before_all.cr2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/invidious/routes/before_all.cr b/src/invidious/routes/before_all.cr
index 396840a4..5695dee9 100644
--- a/src/invidious/routes/before_all.cr
+++ b/src/invidious/routes/before_all.cr
@@ -30,7 +30,7 @@ module Invidious::Routes::BeforeAll
# Only allow the pages at /embed/* to be embedded
if env.request.resource.starts_with?("/embed")
- frame_ancestors = "'self' http: https:"
+ frame_ancestors = "'self' file: http: https:"
else
frame_ancestors = "'none'"
end