Fix duplicate file extension

This commit is contained in:
Omar Roth 2019-03-25 16:32:11 -05:00
parent fd84b57ac8
commit 13924a8353
2 changed files with 8 additions and 8 deletions

View file

@ -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