diff options
author | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2013-02-15 09:49:35 +0200 |
---|---|---|
committer | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2013-02-15 09:49:35 +0200 |
commit | 4821aa6c251a1a2eb4f1fac7bf0f2897a435b48b (patch) | |
tree | 9f4426984e7d53208c51cd4902a23c8bd93eb85c /app | |
parent | a699ebdbcc11051b9473a88788cf8efdde659975 (diff) | |
download | gitlab-ce-4821aa6c251a1a2eb4f1fac7bf0f2897a435b48b.tar.gz |
skip protection to aws3
Diffstat (limited to 'app')
-rw-r--r-- | app/controllers/files_controller.rb | 1 | ||||
-rw-r--r-- | app/uploaders/attachment_uploader.rb | 6 |
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 |