diff options
author | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2015-02-05 09:54:38 -0800 |
---|---|---|
committer | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2015-02-05 09:54:38 -0800 |
commit | 0a9cab4ee65f2b42c56989698c401cab60d68b53 (patch) | |
tree | 270726102d04571e7a45941dc4c7554b30817136 /app/controllers/files_controller.rb | |
parent | 50e8e5943f182c65be1ef7777d06869029886d8e (diff) | |
parent | 8efed8b356606f688c05a1ce423e9001c4aa73b3 (diff) | |
download | gitlab-ce-0a9cab4ee65f2b42c56989698c401cab60d68b53.tar.gz |
Merge branch 'dont-download-image-attachments'
Conflicts:
CHANGELOG
Diffstat (limited to 'app/controllers/files_controller.rb')
-rw-r--r-- | app/controllers/files_controller.rb | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/app/controllers/files_controller.rb b/app/controllers/files_controller.rb index 7937454810d..9671245d3f4 100644 --- a/app/controllers/files_controller.rb +++ b/app/controllers/files_controller.rb @@ -5,7 +5,8 @@ class FilesController < ApplicationController if uploader.file_storage? if can?(current_user, :read_project, note.project) - send_file uploader.file.path, disposition: 'attachment' + disposition = uploader.image? ? 'inline' : 'attachment' + send_file uploader.file.path, disposition: disposition else not_found! end |