diff --git a/src/invidious.cr b/src/invidious.cr index 65a81f79..6824ec74 100644 --- a/src/invidious.cr +++ b/src/invidious.cr @@ -4228,15 +4228,15 @@ get "/videoplayback" do |env| client.get(url, headers) do |response| env.response.status_code = response.status_code - if title = env.params.query["title"]? - # https://blog.fastmail.com/2011/06/24/download-non-english-filenames/ - env.response.headers["Content-Disposition"] = "attachment; filename=\"#{URI.escape(title)}\"; filename*=UTF-8''#{URI.escape(title)}" - end - response.headers.each do |key, value| env.response.headers[key] = value end + if title = query_params["title"]? + # https://blog.fastmail.com/2011/06/24/download-non-english-filenames/ + env.response.headers["Content-Disposition"] = "attachment; filename=\"#{URI.escape(title)}\"; filename*=UTF-8''#{URI.escape(title)}" + end + env.response.headers["Access-Control-Allow-Origin"] = "*" begin diff --git a/src/invidious/views/watch.ecr b/src/invidious/views/watch.ecr index 5173c9fb..0c812757 100644 --- a/src/invidious/views/watch.ecr +++ b/src/invidious/views/watch.ecr @@ -59,17 +59,17 @@