diff --git a/app/controllers/attachments_controller.rb b/app/controllers/attachments_controller.rb index c991fce06..e3d3c5bd4 100644 --- a/app/controllers/attachments_controller.rb +++ b/app/controllers/attachments_controller.rb @@ -89,7 +89,7 @@ class AttachmentsController < ApplicationController tbnail, :filename => filename_for_content_disposition(@attachment.filename), :type => detect_content_type(@attachment, true), - :disposition => 'inline') + :disposition => 'attachment') end else # No thumbnail for the attachment or thumbnail could not be created @@ -321,4 +321,9 @@ class AttachmentsController < ApplicationController request.raw_post end end + + def send_file(path, options={}) + headers['content-security-policy'] = "default-src 'none'; style-src 'unsafe-inline'; sandbox" + super + end end diff --git a/app/controllers/repositories_controller.rb b/app/controllers/repositories_controller.rb index 0e83bfa1e..147a60c12 100644 --- a/app/controllers/repositories_controller.rb +++ b/app/controllers/repositories_controller.rb @@ -433,6 +433,11 @@ class RepositoriesController < ApplicationController end end + def send_file(path, options={}) + headers['content-security-policy'] = "default-src 'none'; style-src 'unsafe-inline'; sandbox" + super + end + def valid_name?(rev) return true if rev.nil? return true if REV_PARAM_RE.match?(rev)