summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2013-02-15 09:49:35 +0200
committerDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2013-02-15 09:49:35 +0200
commit4821aa6c251a1a2eb4f1fac7bf0f2897a435b48b (patch)
tree9f4426984e7d53208c51cd4902a23c8bd93eb85c /app
parenta699ebdbcc11051b9473a88788cf8efdde659975 (diff)
downloadgitlab-ce-4821aa6c251a1a2eb4f1fac7bf0f2897a435b48b.tar.gz
skip protection to aws3
Diffstat (limited to 'app')
-rw-r--r--app/controllers/files_controller.rb1
-rw-r--r--app/uploaders/attachment_uploader.rb6
2 files changed, 5 insertions, 2 deletions
diff --git a/app/controllers/files_controller.rb b/app/controllers/files_controller.rb
index f13a543cfdd..09f1e5512d6 100644
--- a/app/controllers/files_controller.rb
+++ b/app/controllers/files_controller.rb
@@ -1,7 +1,6 @@
class FilesController < ApplicationController
def download
uploader = Note.find(params[:id]).attachment
- uploader.retrieve_from_store!(params[:filename])
send_file uploader.file.path, disposition: 'attachment'
end
end
diff --git a/app/uploaders/attachment_uploader.rb b/app/uploaders/attachment_uploader.rb
index 3dd2117e339..200700b8810 100644
--- a/app/uploaders/attachment_uploader.rb
+++ b/app/uploaders/attachment_uploader.rb
@@ -21,6 +21,10 @@ class AttachmentUploader < CarrierWave::Uploader::Base
end
def secure_url
- "/files/#{model.class.to_s.underscore}/#{model.id}/#{file.filename}"
+ if self.class.storage == CarrierWave::Storage::File
+ "/files/#{model.class.to_s.underscore}/#{model.id}/#{file.filename}"
+ else
+ url
+ end
end
end