From 13924a83537040e6101f17dc07f8197edb12eab4 Mon Sep 17 00:00:00 2001 From: Omar Roth Date: Mon, 25 Mar 2019 16:32:11 -0500 Subject: [PATCH] Fix duplicate file extension --- src/invidious.cr | 10 +++++----- src/invidious/views/watch.ecr | 6 +++--- 2 files changed, 8 insertions(+), 8 deletions(-) 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 @@