Special characters caused error [fixes SCI-315].

This commit is contained in:
Matej Zrimšek 2016-08-09 17:08:47 +02:00
parent c87ba5b45c
commit 854ef0d227
2 changed files with 2 additions and 2 deletions

View file

@ -77,7 +77,7 @@ class AssetsController < ApplicationController
elsif @asset.file.is_stored_on_s3?
redirect_to @asset.presigned_url, status: 307
else
send_file @asset.file.path, filename: @asset.file_file_name,
send_file @asset.file.path, filename: URI.unescape(@asset.file_file_name),
type: @asset.file_content_type
end
end

View file

@ -241,7 +241,7 @@ class Asset < ActiveRecord::Base
key: file.path[1..-1],
expires_in: 30,
# this response header forces object download
response_content_disposition: 'attachment; filename=' + file_file_name)
response_content_disposition: 'attachment; filename=' + URI.escape(file_file_name))
end
end