]> source.dussan.org Git - redmine.git/commitdiff
Merged r22294 and r22295 from trunk to 4.2-stable (#38417).
authorGo MAEDA <maeda@farend.jp>
Mon, 18 Sep 2023 02:35:27 +0000 (02:35 +0000)
committerGo MAEDA <maeda@farend.jp>
Mon, 18 Sep 2023 02:35:27 +0000 (02:35 +0000)
git-svn-id: https://svn.redmine.org/redmine/branches/4.2-stable@22297 e93f8b46-1217-0410-a6f0-8f06a7374b81

app/controllers/attachments_controller.rb
app/controllers/repositories_controller.rb

index d956ac17e193d959b3948f26a013565b302905fb..35c8aa5f9fb810b00c5deeeef2448bdffd24ac12 100644 (file)
@@ -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
@@ -330,4 +330,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
index 60b27e2f27627df84481cc86319c33be4966d09f..59f65b3e977c5afab3efdedd01cc1993a04e20db 100644 (file)
@@ -432,6 +432,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)