fixing condition for Content-Security-Policy

This commit is contained in:
Emilien Devos 2024-10-21 01:20:16 +02:00 committed by Emilien
parent 1954463371
commit c612423a4d

View File

@ -190,7 +190,7 @@ module Invidious::Routes::Watch
captions: video.captions
)
if (CONFIG.invidious_companion && env.params.query["local"] == true)
if (CONFIG.invidious_companion && (preferences.local || preferences.quality == "dash"))
env.response.headers["Content-Security-Policy"] =
env.response.headers["Content-Security-Policy"]
.gsub("media-src", "media-src " + video.invidious_companion["baseUrl"].as_s)